Learn R Programming

kdry (version 0.0.3)

list.update: list.update

Description

Helper function to update items in an R list.

Usage

list.update(main_list, new_list, ...)

Value

A list is returned.

Arguments

main_list

A list, which items should be updated.

new_list

A list with new values of items from main_list that should be updated. All names of new_list must be present in main_list.

...

Further arguments passed to utils::modifyList().

Details

This function is a save wrapper around utils::modifyLists to update items in R lists as it checks for the input types and only accepts named lists.

See Also

Examples

Run this code
l1 <- list("a" = 1, "b" = 2)
l2 <- list("a" = 3, "b" = 4)
list.update(l1, l2)

Run the code above in your browser using DataLab