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

split

Splitting datasets in groups given by factors


Description

Splits data sets of compositions in groups given by factors, and gives the same class as the data to the result.

Usage

## S3 method for class 'acomp'
split(x,f,drop=FALSE,...)
## S3 method for class 'rcomp'
split(x,f,drop=FALSE,...)
## S3 method for class 'aplus'
split(x,f,drop=FALSE,...)
## S3 method for class 'rplus'
split(x,f,drop=FALSE,...)
## S3 method for class 'rmult'
split(x,f,drop=FALSE,...)
## S3 method for class 'ccomp'
split(x,f,drop=FALSE,...)

Arguments

x

a dataset or a single vector of some type

f

a factor that defines the grouping or a list of factors

drop

drop=FALSE also gives (empty) datsets for empty categories

...

Further arguments passed to split.default. Currently (and probably) without any use.

Value

a list of objects of the same type as x.

Author(s)

K.Gerald v.d. Boogaart http://www.stat.boogaart.de

See Also

Examples

data(SimulatedAmounts)
  split(acomp(sa.groups),sa.groups.area)
  lapply( split(acomp(sa.groups),sa.groups.area), mean)

compositions

Compositional Data Analysis

v2.0-1
GPL (>= 2)
Authors
K. Gerald van den Boogaart <boogaart@hzdr.de>, Raimon Tolosana-Delgado, Matevz Bren
Initial release
2021-01-08

We don't support your browser anymore

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