toc | R Documentation |
This reads an R data (RDA) connection and identifies the top-level variables it contains. It returns a description for each of these variables, giving the R type, class, length, names.
It avoids deserializing/creating the objects as much as possible. This is useful when we are dealing with large vectors, data.frames and R objects in general.
toc(file)
file |
the name of the RDA file, or a connection |
An object of class RDAToc
.
This is a list with as many elements as there are top-level
variables/objects in the RDA file.
Each element is a 1-row data.frame describing that object.
Each of these data.frames may have different columns as there are different
characteristics described for different types.
The individual data.frames can be combined with the as.data.frame method.
One can access an element via the RDAToc object to extract the individual element from the RDA file.
Duncan Temple Lang
R Internals manual
load
and Load
in this package.
f = system.file("sampleRDA", "test.rda", package = "RDAInfo")
info = toc(f)
print(info)
# get the first element
info[[1]]
info[["mx"]]
info$mx
info[c("d", "a")]
info2 = as.data.frame(info)
info2$offset
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.