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. c("Q_1", "Q_2")

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:

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"))

[Package sss version 0.2.2 Index]