| import_raw | R Documentation |
Function to import a data.frame object for use in eatGADS while adding explicit variable and value meta information through
separate data.frames.
import_raw(df, varLabels, valLabels = NULL, checkVarNames = TRUE)
df |
A |
varLabels |
A |
valLabels |
A |
checkVarNames |
Should variable names be checked for violations of |
The argument varLables has to contain exactly two variables, namely varName and varLabel. valLables has
to contain exactly four variables, namely varName, value, valLabel and missings. The column value
can only contain numerical values. The column missings can only contain the values "valid" and "miss".
Variables of type factor are not supported in any of the data.frames.
Returns a list with the actual data dat and with all meta information in long format labels.
dat <- data.frame(ID = 1:5, grade = c(1, 1, 2, 3, 1))
varLabels <- data.frame(varName = c("ID", "grade"),
varLabel = c("Person Identifier", "School grade Math"),
stringsAsFactors = FALSE)
valLabels <- data.frame(varName = c("grade", "grade", "grade"),
value = c(1, 2, 3),
valLabel = c("very good", "good", "sufficient"),
missings = c("valid", "valid", "valid"),
stringsAsFactors = FALSE)
gads <- import_raw(df = dat, varLabels = varLabels, valLabels = valLabels, checkVarNames = FALSE)
# Inspect Meta data
extractMeta(gads)
# Extract Data
dat <- extractData(gads, convertLabels = "character")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.