cat2list {rgr}R Documentation

Divides Data into Subsets by Factor

Description

Converts data into a list form where data are grouped together by factor. Achieves the same objective as the base function split.

Usage

cat2list(x, a)

Arguments

x name of the data variable to be processed.
a name of the factor variable by which the data are to be split.

Value

data a list containing factors as columns and the values for those factors as rows. The order of the resulting groups, subsets, is the order in which the factor variable names were encountered in parameter ‘a’ passed to the function.

Note

This function is called by functions tbplot and bwplot to prepare Tukey boxplots and box-and-whisker plots, respectively. It is an integral part of the script shared by Doug Nychka on S-News, April 28, 1992. As such it may pre-date the time that split was added to the S-Plus library.

If by is undefined in the calling functions, tbplot and bwplot, the same result may be achieved by using the split(x, a) construct instead of stating x as the variable to be displayed as boxplots. In which case the data are grouped, subsetted, in alphabetical order of factor variable names.

Author(s)

Douglas W. Nychka


[Package rgr version 1.0.3 Index]