Loading SAS data

Using the haven package to load SAS data: Reading supports both sas7bdat and xpt files.

IQRloadSASdata(
  data_file,
  as.data.frame = TRUE,
  noLabels = TRUE,
  replaceComma = TRUE
)

Arguments

data_file

Path to sas7bdat data file.

as.data.frame

Logical. If TRUE a data.frame is returned.

noLabels

Logical. If TRUE label attributes are removed

replaceComma

If TRUE the "," is exchanged for " " - otherwise not

Value

data frame 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.

Details

Some arguments from haven::read_sas are disabled on purpose as there are till bugs with them ... for now only use it for importing SAS files :)

Removing "," in character columns by default (can be switched off)

See also