1 |
... |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (...)
{
help <- "\n Read.dta reads Stata files using 'read.dta' in 'library(foreign)'\n This appears to be an ideal way of importing spss files in order\n to keep full variable names. Direct use of 'read.spss' on a SPSS\n '.sav' file abbreviates variable names to 8 characters.\n Note: missing.type = T produces warnings.\n"
require("foreign")
dd <- read.dta(...)
cls <- sapply(dd, class)
ch.nams <- names(dd)[cls == "character"]
for (nn in ch.nams) dd[[nn]] <- factor(trim(dd[[nn]]))
dd
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.