stats::zipCol -- convert a
sequence of columns to a list of lists
Introductionstats::zipCol(..) converts a sequence of
columns to a format suitable for creating a stats::sample.
Call(s)stats::zipCol(column1, column2, ..)
Parameterscolumn1, column2, .. |
- | lists. |
Returnsa list of lists.
Related
Functionsstats::sample2list, stats::unzipCol
Detailsstats::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.
Example
1We 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
Example
2We 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