group {nexus} | R Documentation |
Group by One or More Variables
Description
Define or remove the (reference) groups to which the observations belong.
Usage
group(object, ...)
ungroup(object, ...)
## S4 method for signature 'CompositionMatrix'
group(object, by, verbose = getOption("nexus.verbose"), ...)
## S4 method for signature 'GroupedComposition'
group(object, by, add = FALSE, verbose = getOption("nexus.verbose"), ...)
## S4 method for signature 'GroupedComposition'
ungroup(object)
## S4 method for signature 'GroupedLR'
ungroup(object)
## S4 method for signature 'GroupedCLR'
ungroup(object)
## S4 method for signature 'GroupedALR'
ungroup(object)
## S4 method for signature 'GroupedILR'
ungroup(object)
## S4 method for signature 'GroupedPLR'
ungroup(object)
Arguments
object |
An R object (typically, a |
... |
Further parameters to be passed to internal methods. |
by |
A possible value for the groups of |
verbose |
A |
add |
A |
Details
Missing values (NA
) can be used to specify that a sample does not belong
to any group.
Value
-
group()
returns a grouped object of the same sort asobject
. -
ungroup()
returns an ungrouped object of the same sort asobject
.
Author(s)
N. Frerebeau
See Also
Other grouping methods:
group_names()
,
group_split()
,
group_subset()
,
is_assigned()
Examples
## Data from Aitchison 1986
data("slides")
## Coerce to compositional data
coda <- as_composition(slides, groups = 2)
## Grouping metadata
group_levels(coda)
group_names(coda)
group_indices(coda)
group_rows(coda)
group_n(coda)
group_size(coda)
[Package nexus version 0.6.0 Index]