.BG
.FN split
.TL
Split Data by Groups
.CS
split(data, group)
.AG data
vector containing data values to be grouped.
Missing values (`NA's) 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
list 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.
If `data' had a `names' attribute, each element of the list
will have a `names' attribute.
.SH USAGE
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)    # by decades
split(gnp,cycle(gnp))   #component for each month
split(student,grade)
.KW category
.KW manip
.WR
