Description Usage Arguments Value See Also Examples
Reads a SAS 'sas7bdat' file using [haven::read_sas] and then applies the labels given in the formats file (containing 'PROC FORMAT' statements). The labels use [labelled::labelled] and may be coerced to factors or ordered factors if desired.
1 2 3 4 5 6 7 | read_ssocs(
datafile,
formatfile,
fmtfile = NULL,
as_factor = TRUE,
ordered = TRUE
)
|
datafile |
Path to the 'sas7bdat' file to be read by [haven::read_sas] |
formatfile |
Path to the SAS formats file to be read by [read_proc_format] |
fmtfile |
Path to the SAS fmts file to be read by [read_proc_format_vars] |
as_factor |
If TRUE, coerce labelled variables to factor with [haven::as_factor] |
ordered |
If TRUE and as_factor is TRUE, coerce to ordered factor |
A tibble, data frame variant with nice defaults.
Variable labels are stored in the "label" attribute of each variable. It is not printed on the console, but the RStudio viewer will show it.
The vectors may be a labelled vector that may be coerced into a factor or ordered factor.
Other SAS helper functions:
read_proc_format_vars()
,
read_proc_format()
1 2 3 4 | ## Not run:
read_ssocs("pu_ssocs18.sas7bdat", "pu_ssocs18_format.txt")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.