.BG
.VE $Header: /usr/s/current/s/.help/RCS/split,v 1.3 86/10/07 15:30:34 rab Exp $
.FN split
.TL
split: Split Data by Groups
.CS
split(data, group)
.PP
.AG data
vector structure containing data values to be grouped.
Missing values (NAs) are allowed.
.AG group
vector or category giving the group for each data
value. For example, if the third value of `group' is 12, the
third value in `data' will be placed in a group with all
other data values whose group is 12.
.RT
structure in which each component contains all data values
associated with a group. Within each group, data values are
ordered as they originally appeared in `data'.
The name of the component is the corresponding value in `group',
or the corresponding category name.
.PP
The main use for `split' is to create a data structure to give
to `boxplot'.
A combination of `code' and `tapply'
is usually preferred to
using `split' followed by `sapply'.
.EX
boxplot(split(income,month))
split(people,age%/10)    # note integer divide
split(gnp,cycle(gnp))   #component for each month
split(student,grade)
.KW basic*
.KW category
.KW structure
.KW manip
.WR
