save_to_rds_with_backup: Serialization Interface for Single Objects with backup

Description Usage Arguments See Also

View source: R/IO_datafiles.R

Description

Function to write a single object to file, but create a backup file first if an older version of the file exists. This backup is restored in case the writing to the file fails. Situations where saveRDS may fail include forced termination of the running R process (e.g., HPC schedulers); those situations likely will not allow that the original file be restored from the backup – this will have to be done manually.

Usage

1
save_to_rds_with_backup(object, file, tag_backup = "backup", ...)

Arguments

object

R object to serialize.

file

a connection or the name of the file where the R object is saved to or read from.

tag_backup

A character string. A tag that is appended at the end of the file name to identify the backup.

See Also

saveRDS


Burke-Lauenroth-Lab/SoilWat_R_Wrapper documentation built on Aug. 14, 2020, 5:17 p.m.