showCodebook {EdSurvey} | R Documentation |
Summary Codebook
Description
Retrieves variable names, variable labels, and value labels for an
edsurvey.data.frame
, a light.edsurvey.data.frame
, or an edsurvey.data.frame.list
.
Usage
showCodebook(
data,
fileFormat = NULL,
labelLevels = FALSE,
includeRecodes = FALSE
)
Arguments
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 |
Value
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
Author(s)
Michael Lee and Paul Bailey
Examples
## 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)