stats::zipCol
-- convert a
sequence of columns to a list of listsstats::zipCol
(..)
converts a sequence of
columns to a format suitable for creating a stats::sample
.
stats::zipCol(column1, column2, ..)
column1, column2, .. |
- | lists. |
a list of lists.
stats::sample2list
, stats::unzipCol
stats::zipCol
is useful for converting column data
given in lists to a list of lists accepted by stats::sample
.stats::zipCol
is the inverse of stats::unzipCol
.We convert a single column to a nested list:
>> stats::zipCol([a, b, c])
[[a], [b], [c]]
This list is accepted by stats::sample
:
>> stats::sample(%)
a b c
We build a sample consisting of two columns:
>> column1 := [122, 442, 322]: column2 := [s, s, p]: stats::zipCol(column1, column2)
[[122, s], [442, s], [322, p]]
>> stats::sample(%)
122 s 442 s 322 p