modifyList
Recursively Modify Elements of a List
Description
Recursively modify elements of list, including the nested list. Elements are identified by their names.
Usage
modifyList(x, val)
Arguments
x |
a list object to be modified.
|
val |
a list object that has components to replace the elements in x.
|
Details
Recursively finds elements in a list. Elements are identified by their names.
If elements of var exists in x, modifies the existed element.
If elements of var do not exist in x, adds elements to list x.
Value
returns the modification of list x with the modified elements that are identified by their names.
See Also
Examples
orig.list <- list(a = 1, b = list(b1 = 2, b2 = TRUE), c = list("iii"))
modifyList(orig.list,
list(a = 3, b = list(b3 = "new b3", b2 = FALSE), c = FALSE))