showCodebook | R Documentation |
Retrieves variable names, variable labels, and value labels for an
edsurvey.data.frame
, a light.edsurvey.data.frame
, or an edsurvey.data.frame.list
.
showCodebook(
data,
fileFormat = NULL,
labelLevels = FALSE,
includeRecodes = FALSE
)
data |
an |
fileFormat |
a character string indicating the data source to search for variables.
The default |
labelLevels |
a logical value; set to |
includeRecodes |
a logical value; set to |
a data.frame
that shows the variable names, variable labels, value labels,
value levels (if applicable), and the file format data source from an edsurvey.data.frame
, a light.edsurvey.data.frame
,
or an edsurvey.data.frame.list
Michael Lee and Paul Bailey
## Not run:
# read in the example data (generated, not real student data)
sdf <- readNAEP(path=system.file("extdata/data", "M36NT2PM.dat", package="NAEPprimer"))
# search both the student and school files, returning levels for variable values
showCodebook(data=sdf, fileFormat=c("student","school"), labelLevels = TRUE, includeRecodes = FALSE)
# return codebook information for the student file, excluding variable value levels,
# including recoded variables
sdf <- recode.sdf(sdf, recode = list(dsex = list(from = c("Male"), to = c("MALE"))))
showCodebook(data=sdf, fileFormat=c("student"), labelLevels = FALSE, includeRecodes = TRUE)
# return codebook information for the student file, including variable value levels
# and recoded variables
showCodebook(data=sdf, fileFormat=c("student","school"), labelLevels = FALSE, includeRecodes = TRUE)
# return codebook information for all codebooks in an edsurvey.data.frame; commonly use View()
View(showCodebook(data=sdf))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.