Saves an rda in the 'data' directory of a data repository.

save uses either the base or datarepository versions of save depending on arguments. If the file argument is used, it is assumed that base::save was intended, otherwise the datarepository version is used.

write uses the readr::write_ functions with the path to the data repository supplied when omitted. If the ext is xlsx then the openxlsx package is used to write an Excel file. Files are written into the data subdirectory of the data repository and can be read into objects using the data function as normal.

save_to_data_repository(..., path = data_repository_path())

save(...)

write(..., ext = "tsv")

Arguments

...

Arguments passed to readr::write_{csv,tsv} or openxlsx::write.xlsx

path

Path to 'data' subdirectory of a data repository in which objects will be saved, defaults to datarepo:::data_repository_path()

ext

File extension - format to write - one of csv, tsv or xlsx

Value

Invisibly returns paths to saved object(s).

Functions

  • save_to_data_repository: Save to data repository

  • save: Save data using base::save

  • write: Write a file to the data repository data directory

See also

readr write_csv

readr write_tsv

openxlsx write.xlsx