export: Export a file

exportCSVR Documentation

Export a file

Description

Handy wrapper functions to export data tables that then returns the file path of the exported file. This can be useful in applications such as within tarchetypes::tar_file.

Usage

exportCSV(x, file, ...)

exportXLSX(x, file, ...)

Arguments

x

a data frame or tibble to export

file

file or connection to write to

...

arguments to pass to readr::write_csv or xlsx::write.xlsx

Details

If the file path directory does not exist, the directory is created recuresively prior to export.

Value

The file path of the exported file.

Examples

## Export to a csv
exportCSV(iris, paste0(tempdir(),"/iris.csv"))

## Export to an Excel workbook
exportXLSX(iris, paste0(tempdir(),"/iris.xlsx"))

jasenfinch/jfmisc documentation built on Feb. 21, 2024, 7:10 a.m.