Skip to contents

Add named item (including NULL) to a list.

Usage

add_item_to_list(l, key, value = NULL)

Arguments

l

A list.

key

A character scalar: name under which value will be placed.

value

Any object.

Value

A list.

Examples

add_item_to_list(list(1, a = 2), "b")
#> [[1]]
#> [1] 1
#> 
#> $a
#> [1] 2
#> 
#> $b
#> NULL
#>