unpack: Unpack values

Description Usage Arguments Details

Description

The syntax c[...] = value unpacks the vector or list value into as many separate variables, specified as ..., as there are items.

Usage

1
c[...] = value

Arguments

...

variable names to assign to.

value

vector or list to unpack.

Details

The number of names in ... must match length(value). If there are too few or too many names, an error is raised.

An exception is made when the last name in ... is an index-less subset expression, i.e. name[]. In that case, the first N-1 elements from value are assigned to the first N-1 variable names, and the remaining elements are assigned to name.


klmr/unpack documentation built on March 26, 2021, 2:01 a.m.