groups {nexus} | R Documentation |
Working With Groups
Description
Retrieves or defines the (reference) groups to which the observations belong.
Usage
groups(object)
groups(object) <- value
any_assigned(object)
is_assigned(object)
## S4 method for signature 'CompositionMatrix'
is_assigned(object)
## S4 method for signature 'LogRatio'
is_assigned(object)
## S4 method for signature 'CompositionMatrix'
any_assigned(object)
## S4 method for signature 'LogRatio'
any_assigned(object)
## S4 method for signature 'CompositionMatrix'
groups(object)
## S4 method for signature 'LogRatio'
groups(object)
## S4 method for signature 'OutlierIndex'
groups(object)
## S4 replacement method for signature 'CompositionMatrix,ANY'
groups(object) <- value
## S4 replacement method for signature 'CompositionMatrix,list'
groups(object) <- value
Arguments
object |
An object from which to get or set |
value |
A possible value for the |
Details
Missing values (NA
) or empty strings (""
) can be used to specify that a
sample does not belong to any group.
Value
-
groups() <- value
returns an object of the same sort asx
with the new group names assigned. -
groups()
returns acharacter
vector giving the group names ofx
. -
any_assigned()
returns alogical
scalar specifying whether or notx
has groups. -
is_assigned()
returns alogical
vector specifying whether or not an observation belongs to a group.
Author(s)
N. Frerebeau
See Also
Other mutators:
mutators
,
totals()
Examples
## Data from Aitchison 1986
data("slides")
head(slides)
## Coerce to compositional data
coda <- as_composition(slides, groups = 2)
groups(coda)
[Package nexus version 0.3.0 Index]