Define or remove the (reference) groups to which the observations belong.
group(object, ...)ungroup(object, ...)
# S4 method for CompositionMatrix
group(object, by, verbose = getOption("nexus.verbose"), ...)
# S4 method for GroupedComposition
group(object, by, add = FALSE, verbose = getOption("nexus.verbose"), ...)
# S4 method for GroupedComposition
ungroup(object)
# S4 method for GroupedLR
ungroup(object)
# S4 method for GroupedCLR
ungroup(object)
# S4 method for GroupedALR
ungroup(object)
# S4 method for GroupedILR
ungroup(object)
# S4 method for GroupedPLR
ungroup(object)
group()
returns a grouped object of the same sort as object
.
ungroup()
returns an ungrouped object of the same sort as object
.
An R object (typically, a CompositionMatrix
object).
Further parameters to be passed to internal methods.
A possible value for the groups of object
(typically, a
character
vector). If value
is a list
,
interaction(by)
defines the grouping.
A logical
scalar: should R report extra information
on progress?
A logical
scalar. If TRUE
, add to existing groups.
N. Frerebeau
Missing values (NA
) can be used to specify that a sample does not belong
to any group.
Other grouping methods:
group_extract()
,
group_metadata
,
group_split()
## 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_length(coda)
group_size(coda)
Run the code above in your browser using DataLab