write_csv_safely: Safely Save CSV File Without Overwriting the File

write_csv_safelyR Documentation

Safely Save CSV File Without Overwriting the File

Description

Wraps write_csv. If the file already exists, it will not be overwritten. A message will be printed indicating whether the file was successfully written or if it already existed.

Usage

write_csv_safely(..., file = stop("'file' must be specified"))

Arguments

...

Data frame and other arguments, passed on to write_csv. Required.

file

Path/file name to for output. Required.

Value

None.

Examples

## Not run: 
data(mtcars)
mtcars %>%
  dplyr::select(gear, mpg, am) %>%
  write_csv_safely(file = "mtcars.csv")

## End(Not run)

stopsack/khsmisc documentation built on Sept. 22, 2023, 12:26 p.m.