Read and write SAS files
read_sas()
supports both sas7bdat files and the accompanying sas7bcat files
that SAS uses to record value labels. write_sas()
is currently experimental
and only works for limited datasets.
read_sas( data_file, catalog_file = NULL, encoding = NULL, catalog_encoding = encoding, col_select = NULL, skip = 0L, n_max = Inf, cols_only = "DEPRECATED", .name_repair = "unique" ) write_sas(data, path)
data_file, catalog_file |
Path to data and catalog files. The files are
processed with |
encoding, catalog_encoding |
The character encoding used for the
|
col_select |
One or more selection expressions, like in
|
skip |
Number of lines to skip before reading data. |
n_max |
Maximum number of lines to read. |
cols_only |
Deprecated: Use |
.name_repair |
Treatment of problematic column names:
This argument is passed on as |
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.
write_sas()
returns the input data
invisibly.
path <- system.file("examples", "iris.sas7bdat", package = "haven") read_sas(path)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.