list.update {kdry}R Documentation

list.update

Description

Helper function to update items in an R list.

Usage

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

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.

Value

A list is returned.

See Also

utils::modifyList()

Examples

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

[Package kdry version 0.0.2 Index]