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" )
Path to data and catalog files. The files are
The character encoding used for the
catalog_encoding respectively. A value of
NULL uses the
encoding specified in the file; use this argument to override it if it is
One or more selection expressions, like in
list() to use more than one expression.
?dplyr::select for details on available selection options. Only the
specified columns will be read from
Number of lines to skip before reading data.
Maximum number of lines to read.
Treatment of problematic column names:
"minimal": No name repair or checks, beyond basic existence,
"unique": Make sure names are unique and not empty,
"check_unique": (default value), no name repair, but check they are
"universal": Make the names
unique and syntactic
a function: apply custom name repair (e.g.,
.name_repair = make.names
for names in the style of base R).
A purrr-style anonymous function, see
This argument is passed on as
See there for more details on these terms and the strategies used
to enforce them.
Data frame to write.
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