This function will take a data frame in R and write it out to csv. It also creates a metadata folder, storing the xpt file along with other useful information.
write_derived(
.data,
.spec,
.file,
.comment = NULL,
.subject_col = "ID",
.prev_file = NULL,
.compare_from_svn = TRUE,
.return_base_compare = FALSE,
.execute_diffs = TRUE
)
a data frame
a yspec object
csv file name to write out to (including path)
explanation of data
subject column name (defaults to ID)
csv file name of previous version (defaults to .file)
logical. Should the data comparison be done on the latest svn version? (If not, local version is used)
logical. Should the two current and previous versions of the datasets be returned?
logical. Should the diffs be executed?
if (FALSE) {
nm_spec <- yspec::ys_load(system.file("derived", "pk.yml", package = "mrgda"))
nm <- readr::read_csv(system.file("derived", "pk.csv", package = "mrgda"), na = ".")
write_derived(.data = nm, .spec = nm_spec, .file = "data/derived/pk.csv")
}