save: Version of the base::save function that allows us to append...

Description Usage Arguments Details Value Author(s) See Also Examples

Description

This is a trivial extension of the save function which provides an append argument to allow the caller to simply add one or more objects to an existing saved file. At present, it is not particularly efficient and merely loads the contents of the original file and then re-serializes these along with the new objects. The purpose is to reduce the number of commands to achieve this effect.

Usage

1
2
save(..., list = character(0), file = stop("'file' must be specified"), ascii = FALSE, version = NULL, 
        envir = parent.frame(), compress = !ascii, eval.promises = TRUE, append = FALSE)

Arguments

...

see save

list

see save

file

see save

ascii

see save

version

see save

envir

see save

compress

see save

eval.promises

see save

append

a logical value indicating whether to add the specified objets to the existing file or to overwrite that file with just these objects. This is FALSE by default to preserve the behaviour of the original version, save

Details

In the future, this could be more intelligent and add to the existing file by writing to the end. This may require that the table of contents be written at the end of the file so that we can add to it without rewriting the entire thing.

Value

See save.

Author(s)

Duncan Temple Lang

See Also

save load

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
 x = 1
 a = 1:10

 rda = tempfile()
 save(x, a, file = rda)

 toc(rda)

 b = letters
 z = rnorm(3)
 save(b, z, file = rda, append = TRUE)
 toc(rda)

 unlink(rda)

omegahat/RTiming documentation built on May 24, 2019, 1:55 p.m.