A thin wrapper around readr::write_csv() that writes data to file and
returns the file path. This is useful as a targets format function where the
target value should be the path to the written file.
Arguments
- data
A data frame to write.
- file
A string giving the file path to write to.
- ...
Additional arguments passed to
readr::write_csv().
Examples
targets::tar_dir({
create_csv(data.frame(x = 1:3), "test.csv")
})