Learn R Programming

largeList (version 0.3.1)

modifyNameInList: Modify names of elements in a list file.

Description

Modify names of elements in a list file.

Usage

modifyNameInList(file, index, name)

Arguments

file
Name of file.
index
A numeric or logical vector.
name
A character vector consisting replacement names.

Value

invisible TRUE if no error occurs.

Details

Modify names of elements with given indices by replacement values provided in parameter name. If the length of replacement values is shorter than the length of indices, values will be used circularly.

See Also

largeList

Examples

Run this code
list_1 <- list("A" = c(1,2), "B" = "abc", list(1, 2, 3))
saveList(object = list_1, file = "example.llo")

# by numeric indices
modifyNameInList(file = "example.llo", index = c(1,2), name = c("AA","BB"))

# by logical indices
modifyNameInList(file = "example.llo", index = c(TRUE, TRUE, FALSE), name = c("AA","BB"))

Run the code above in your browser using DataLab