Previous Page Next Page Contents

stats::unzipCol -- extract columns from a list of lists

Introduction

stats::unzipCol(list) extracts the columns of a matrix structure encoded by a list of lists.

Call(s)

stats::unzipCol(list)

Parameters

list - a list of lists.

Returns

a sequence of lists to be regarded as columns.

Related Functions

stats::col, stats::sample2list, stats::zipCol

Details

Example 1

We extract the columns from a list of rows representing a matrix structure:

>> stats::unzipCol([[a11, a12], [a21, a22], [a31, a32]])
   
                     [a11, a21, a31], [a12, a22, a32]
      

Example 2

A list of rows is used to create a sample:

>> stats::sample([[123, s, 1/2], [442, s, -1/2], [322, p, -1/2]])
   
                              123  s   1/2
                              442  s  -1/2
                              322  p  -1/2
      

We re-convert the sample to a list of lists:

>> stats::sample2list(%)
   
              [[123, s, 1/2], [442, s, -1/2], [322, p, -1/2]]
      

Finally, we extract the columns:

>> stats::unzipCol(%)
   
               [123, 442, 322], [s, s, p], [1/2, -1/2, -1/2]
      

Changes




Do you have questions or comments?


Copyright © SciFace Software GmbH & Co. KG 2000