Save a dataset
save_data(dataset, path, type = ".rds", name = NULL)
(list) One or more datasets of the structure returned by
(character) Path to the directory in which
(character) Type of file to save the
(character) An optional argument for setting the saved file name (for .rds) if you'd like it to be different than
type = ".rds", then an .rds representation of
dataset is returned.
type = ".csv", then an set of .csv files are written to a sub-directory of
path named after the data package/product ID.
Subsequent calls won't overwrite files or directories
# Create directory for the data mypath <- paste0(tempdir(), "/data") dir.create(mypath) # Save as .rds save_data(ants_L1, mypath)#>#>  "ants_L1.rds"# Save as .rds with the name "mydata" save_data(ants_L1, mypath, name = "mydata")#>#>  "ants_L1.rds" "mydata.rds"# Save as .csv save_data(ants_L1, mypath, type = ".csv")#>#>  "ants_L1.rds" "edi.193.5" "mydata.rds"