Save comma separated value files, if file exists, backup original 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)
#> [1] "/private/var/folders/4d/0gnh84wj53j7wyk695q0tc_80000gn/T/RtmpDbjk7R/file16be7c575e87"
# Check whether file exists
file.exists(f)
#> [1] TRUE
# write again, and the old file will be copied
safe_write_csv(x, f)
#> [1] "/private/var/folders/4d/0gnh84wj53j7wyk695q0tc_80000gn/T/RtmpDbjk7R/file16be7c575e87"