Attach an object to the end of a list

attach_obj(x = list(), obj)

Arguments

x

A list.

obj

An object to be attached as the last element of the list x.

Value

The list x with obj attached as its last and unnamed element.

Examples


l <- list(a = 1, b = 2)
attach_obj(l, obj = 3)
#> $a
#> [1] 1
#> 
#> $b
#> [1] 2
#> 
#> [[3]]
#> [1] 3
#> 
 #> $a
 #> [1] 1
 #>
 #> $b
 #> [1] 2
 #>
 #> [[3]]
 #> [1] 3