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

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

Arguments

...

Data frame or other object, and further arguments, passed on to saveRDS. Required.

file

Path/file name to for output. Required.

Value

None.

Examples

if (FALSE) {
data(mtcars)
mtcars %>%
  saveRDS_safely(file = "dataset.rds")
}