save_safely: Safely Save R Objects Without Overwriting the File

save_safelyR Documentation

Safely Save R Objects Without Overwriting the File

Description

Wraps save. 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

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

Arguments

...

Data frame(s), other object(s), and further arguments, passed on to save. Required.

file

Path/file name to for output. Required.

Value

None.

Examples

## Not run: 
data(mtcars)
mtcars %>%
  save_safely(file = "dataset.RData")

## End(Not run)

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