tocRDA: Get the table of contents of an RDA file

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

View source: R/rda.R

Description

This function reads an RDA file created via the save function and returns a description of all the top-level objects in that file. It avoids loading all of the objects in memory at the same time.

The idea is to allow users look at RDA files without loading the entire collection of objects into the R session and to provide a framework that others can use to work with RDA files. The framework could be adapted to read specific objects.

Usage

1
tocRDA(filename = system.file("sampleData", "m.rda", package = "RTools"), as.data.frame = TRUE)

Arguments

filename

a connection object or a file name

as.data.frame

a logical value indicating whether the result should be a data frame or a list with elements describing each object.

Details

This is quite slow as it is written in R. It could be written in C, given the prototype as a guide.

Value

If as.data.frame is TRUE, a data frame with a row for each top-level object in the RDA file.

Author(s)

Duncan Temple Lang

References

R file format in the R Import/Export manual

See Also

save and load

Examples

1
2
3
4
 tocRDA(system.file("sampleData", "lots.rda", package = "RDA"))

 els = tocRDA(system.file("sampleData", "lots.rda", package = "RDA"), FALSE)
 sapply(els, class)

omegahat/RDA documentation built on May 24, 2019, 1:53 p.m.