rotate_rds | R Documentation |
The rotate_rds*()
functions are wrappers around base::saveRDS() that
create a backup of the destination file (if it exists) instead of just
overwriting it.
rotate_rds( object, file = "", ascii = FALSE, version = NULL, compress = TRUE, refhook = NULL, ..., on_change_only = FALSE ) rotate_rds_date( object, file = "", ascii = FALSE, version = NULL, compress = TRUE, refhook = NULL, ..., age = -1L, on_change_only = FALSE ) rotate_rds_time( object, file = "", ascii = FALSE, version = NULL, compress = TRUE, refhook = NULL, ..., age = -1L, on_change_only = FALSE )
object |
R object to serialize. |
file |
a connection or the name of the file where the R object is saved to or read from. |
ascii |
a logical. If |
version |
the workspace format version to use. |
compress |
a logical specifying whether saving to a named file is
to use |
refhook |
a hook function for handling reference objects. |
... |
Arguments passed on to
|
on_change_only |
|
age |
minimum age after which to backup/rotate a file; can be
(if |
the path to file
(invisibly)
The default value for age
is different for rotate_rds_date()
(-1
)
than for rotate_date()
(1
) to make it a bit safer. This means if you
execute rotate_date()
twice on the same file on a given day it will
silently not rotate the file, while rotate_rds_date()
will throw an
error.
dest <- tempfile() rotate_rds(iris, dest) rotate_rds(iris, dest) rotate_rds(iris, dest) list_backups(dest) # cleanup unlink(list_backups(dest)) unlink(dest)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.