R markdown error

1,677 views
Skip to first unread message

Gg_R

unread,
Nov 15, 2014, 2:14:52 PM11/15/14
to kn...@googlegroups.com
Hi, can someone tell me what does this error message mean? I am using the survey package to apply the svydesign function.

Code: 

ihisDesign1 <- svydesign(id=~PSU, strata=~STRATA, weights=~SAMPWEIGHT, nest=TRUE, data= ihisFinal)


Error Message after selecting 'Knit HTML' in R Studio: 

Error in eval(expr, envir, enclos) : could not find function "svydesign"
Calls: <Anonymous> ... handle -> withCallingHandlers -> withVisible -> eval -> eval
Execution halted

Gg_R

unread,
Nov 15, 2014, 3:13:18 PM11/15/14
to kn...@googlegroups.com
ok, I figured it out. I need to add the following code before applying survey design. 
require(survey)

Yihui Xie

unread,
Nov 15, 2014, 3:59:02 PM11/15/14
to Gg_R, knitr
I hate repeating it, but it is library():
http://yihui.name/en/2014/07/library-vs-require/

Regards,
Yihui
--
Yihui Xie <xiey...@gmail.com>
Web: http://yihui.name

Rafael Sierra

unread,
Sep 27, 2015, 3:03:55 PM9/27/15
to knitr
I'm getting this same error in markdown but with any operation that requires to evaluate a variable in the workspace. Does anybody know why that would be happening?
Reply all
Reply to author
Forward
0 new messages