Skip to contents

Writes a data frame to a SAS transport file (.xpt) named like "[domain].xpt"

Usage

write_tbl_to_xpt(tbl, filename, dir = NULL, label = NULL)

Arguments

tbl

a data frame to write

filename

a string, the SDTM domain or supplemental domain name which will become the file name and the name attribute of the transport file, the .xpt file extension is optional

dir

a string, the directory to write to, default is NULL

label

a string, the data set name/label for the haven::write_xpt() name argument. The default is NULL in which case the filename will be used. label must be 8 characters or less.

Value

nothing

Details

Files will be written using version 5 .xpt files

Examples

tbl <- dplyr::tibble(one = as.numeric(1:3), two = letters[1:3])
path <- tempdir()
write_tbl_to_xpt(tbl, filename = "test.xpt", dir = path)