readList {largeList} | R Documentation |
Get elements from a list file.
readList(file, index = NULL)
file |
Name of file. |
index |
|
If no indices provided, the whole list will be read. Given index could be a numeric (integer)
vector, a logical vector or a character vector representing the names. If there exist more then one elements
corresponding to a given name, the first matched will be returned (not necessary to be the first
one in index order). If there are no elements with given name, NULL
will be returned.
Files created by saveRDS
can't be read.
When it takes long time to process, some verbose info will be printed to console,
which can be switched off by setting options(list(largeList.report.progress = FALSE))
.
A list object.
list_1 <- list("A" = c(1,2), "B" = "abc", list(1, 2, 3)) saveList(object = list_1, file = "example.llo") # read the whole list readList(file = "example.llo") # by numeric indices readList(file = "example.llo", index = c(1, 3)) # by names readList(file = "example.llo", index = c("A", "B")) # by logical indices readList(file = "example.llo", index = c(TRUE, FALSE, TRUE))