pack: Pack values into a named list.

View source: R/pack.R

packR Documentation

Pack values into a named list.

Description

This function packs values given by name into a named list.

Usage

pack(..., .wrapr_private_var_env = parent.frame())

Arguments

...

values to pack, these should be specified by name (not as constants).

.wrapr_private_var_env

environment to evaluate in

Value

named list of values

See Also

unpack

Examples


x <- 1
y <- 2
pack(x, y)  # list(x = 1, y = 2)

pack(a = x, y)  # list(a = 1, y = 2)

pack(a = 5, y)  # list(a = 5, y = 2)

pack(1, 2)  # list('1' = 1, '2' = 2)

v <- pack(x = 8, y = 9)  # list(x = 8, y = 9)
v -> unpack[x, y]
print(x)  # 8
print(y)  # 9


wrapr documentation built on Aug. 20, 2023, 1:08 a.m.