read.sss {sss} | R Documentation |
Reads a triple-s XML (asc) data file, as specified by the triple-s XML standard.
Description
This function reads and parses a .sss
XML metadata file as well as its
associated .asc
data file. The sss standard defines a standard survey
structure.
Usage
read.sss(
sssFilename,
ascFilename = guess_asc_filename(sssFilename),
sep = "_",
verbose = FALSE
)
Arguments
sssFilename |
Character string: name of .sss file containing the survey metadata |
ascFilename |
Character string: name of .asc (or .csv) file containing survey data. If this is not provided, guesses the filename using |
sep |
Character vector defining the string that separates question and
subquestion labels, e.g. |
verbose |
If TRUE, prints messages when reading data files. Defaults to FALSE. |
Value
A data frame with one element (column) for each variable in the data set.
The resulting data.frame contains several attributes:
-
variable.labels
: a named list of value labels with one element per variable, either NULL or a named character vector -
label.table
: a named list with one element per question. Every element is a named character string that contains the label codes for that question.
References
https://triple-s.org/
See Also
Other read functions:
readSSSdata()
,
readSSSmetadata()
Examples
example <- system.file("sampledata/sample-1.sss", package = "sss")
# read.sss() automatically guesses the data file name
read.sss(system.file("sampledata/sample-1.sss", package = "sss"))
read.sss(system.file("sampledata/sample-2.sss", package = "sss"))
read.sss(system.file("sampledata/sample-3.sss", package = "sss"))