Total newbie to R, have just spent a couple of hours playing and thought I'd have a play with some of the NHANES datasets e.g. ftp://ftp.cdc.gov/pub/Health_Statistics/NCHS/nhanes/2003-2004/
So grabbed a couple and after a play with merge(bmx_c, demo_c)
and a quick Google I thought the sqldf
library would be a more efficient way to merge / extract just a few columns from the files, to play with, but I've hit a problem.
Error in match.fun(asfn) :
'c("as.labelled", "as.integer")' is not a function, character or symbol**
The NHANES files are in SAS format so I had to:
install.packages("Hmisc")
install.packages("sqldf")
library(Hmisc)
library(sqldf)
demo_c <- sasxport.get("DEMO_C.XPT")
bmx_c <- sasxport.get("BMX_C.XPT")
is.data.frame(demo_c)
[1] TRUE
sqldf("select seqn from demo_c")
Error in match.fun(asfn) :
'c("as.labelled", "as.integer")' is not a function, character or symbol
>
summary(demo_c$seqn)
Min. 1st Qu. Median Mean 3rd Qu. Max.
21000 23540 26070 26070 28600 31130
>
I'm guessing some type conversion is required, but I don't know the subtleties of R.