read_sas {haven} | R Documentation |
Reading supports both sas7bdat files and the accompanying sas7bdat files that SAS uses to record value labels. Writing value labels is not currently supported.
read_sas(data_file, catalog_file = NULL, encoding = NULL) write_sas(data, path)
data_file, catalog_file |
Path to data and catalog files. The files are
processed with |
encoding |
The character encoding used for the file. This defaults to the encoding specified in the file, or UTF-8. You can use this argument to override the value stored in the file if it is correct |
data |
Data frame to write. |
path |
Path to file where the data will be written. |
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.
path <- system.file("examples", "iris.sas7bdat", package = "haven") read_sas(path)