This function packs values given by name into a named list.
pack(..., .wrapr_private_var_env = parent.frame())
... | values to pack, these should be specified by name (not as constants). |
---|---|
.wrapr_private_var_env | environment to evaluate in |
named list of values
x <- 1 y <- 2 pack(x, y) # list(x = 1, y = 2)#> $x #> [1] 1 #> #> $y #> [1] 2 #>pack(a = x, y) # list(a = 1, y = 2)#> $a #> [1] 1 #> #> $y #> [1] 2 #>pack(a = 5, y) # list(a = 5, y = 2)#> $a #> [1] 5 #> #> $y #> [1] 2 #>pack(1, 2) # list('1' = 1, '2' = 2)#> $`1` #> [1] 1 #> #> $`2` #> [1] 2 #>#> [1] 8#> [1] 9