safe_write_csv: Save data to comma separated value files with backups

View source: R/csv.R

safe_write_csvR Documentation

Save data to comma separated value files with backups

Description

Save comma separated value files, if file exists, backup original file.

Usage

safe_write_csv(x, file, ..., quiet = FALSE)

Arguments

x, file, ...

pass to write.csv

quiet

whether to suppress overwrite message

Value

Normalized path of file

Examples


f <- tempfile()
x <- data.frame(a = 1:10)

# File not exists, same as write file, returns normalized `f`
safe_write_csv(x, f)

# Check whether file exists
file.exists(f)

# write again, and the old file will be copied
safe_write_csv(x, f)


raveio documentation built on July 26, 2023, 5:29 p.m.