sub-subset-.largeList: Overload of operator [[]]<-.

Description Usage Arguments Details See Also Examples

Description

Overload of operator [[]]<-.

Usage

1
2
## S3 replacement method for class 'largeList'
x[[index = NULL]] <- value

Arguments

x

A largeList object created by getList.

index

NULL or a numeric, character vector with length 1.

value

NULL, a vector or a list.

Details

It behaviours the same as a normal list object. If index is not provided, the list file binding with the largeList object will be truncated and elements in value will be saved to the list file. If value is NULL, element with given index will be removed.

See Also

largeList

Examples

1
2
3
4
5
6
7
largelist_object <- getList("example.llo", truncate = TRUE)
largelist_object[[]] <- list("A" = 1, "B" = 2, "C" = 3)  ## assign list to the list file
largelist_object[[1]] <- NULL ## remove first element
largelist_object[["B"]] <- NULL ## remove element with name "B"
largelist_object[["C"]] <- 5 ## change value
largelist_object[[2]] <- 5 ## change value
largelist_object[[4]] <- 6 ## append 6 to 4th and NULL to 3rd position

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