modifyInList: Modify elements in a list file.

Description Usage Arguments Details Value See Also Examples

View source: R/Exports.R

Description

Modify elements in a list file.

Usage

1
modifyInList(file, index, object)

Arguments

file

Name of file.

index

A numeric, logical or character vector.

object

A list consisting of replacement values.

Details

It modifies elements with given indices by replacement values provided in parameter object. If length of replacement values is shorter than length of indices, values will be used circularly. This function may relocate all the data in the stored file, thus can be very slow! Please consider to call this function batchwise instead of one by one.
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)).

Value

invisible TRUE if no error occurs.

See Also

largeList

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
list_1 <- list("A" = c(1,2), "B" = "abc", list(1, 2, 3))
saveList(object = list_1, file = "example.llo")

# by numeric indices
modifyInList(file = "example.llo", index = c(1,2), object = list("AA","BB"))

# by names
modifyInList(file = "example.llo", index = c("AA","BB"), object = list("A","B"))

# by logical indices
modifyInList(file = "example.llo", index = c(TRUE, FALSE, TRUE), object = list("A","B"))

largeList documentation built on May 1, 2019, 10:55 p.m.