Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

cat2list

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 tbplots and bwplots 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, tbplots and bwplots, 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


rgr

Applied Geochemistry EDA

v1.1.15
GPL-2
Authors
Robert G. Garrett
Initial release
2018-03-05

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.