Learn R Programming

nexus (version 0.4.0)

group_metadata: Grouping Metadata

Description

Retrieve the (reference) groups to which the observations belong.

Usage

group_levels(object)

group_names(object)

group_rows(object)

group_length(object)

group_size(object)

group_indices(object)

is_assigned(object)

any_assigned(object)

all_assigned(object)

# S4 method for ReferenceGroups group_levels(object)

# S4 method for ReferenceGroups group_names(object)

# S4 method for ReferenceGroups group_indices(object)

# S4 method for ReferenceGroups group_rows(object)

# S4 method for ReferenceGroups group_length(object)

# S4 method for ReferenceGroups group_size(object)

# S4 method for ReferenceGroups is_assigned(object)

# S4 method for ReferenceGroups any_assigned(object)

# S4 method for ReferenceGroups all_assigned(object)

Arguments

object

A grouped R object.

Functions

  • group_levels(ReferenceGroups): returns a character vector giving the group names.

  • group_names(ReferenceGroups): returns a character vector giving the name of the group that each observation belongs to.

  • group_indices(ReferenceGroups): returns an integer vector giving the group that each value belongs to.

  • group_rows(ReferenceGroups): returns a list of integer vectors giving the observation that each group contains.

  • group_length(ReferenceGroups): gives the total number of groups.

  • group_size(ReferenceGroups): gives the size of each group.

  • is_assigned(ReferenceGroups): returns a logical vector specifying whether or not an observation belongs to a group.

  • any_assigned(ReferenceGroups): returns an logical scalar specifying if any observation belongs to a group.

  • all_assigned(ReferenceGroups): returns an logical scalar specifying if all observations belong to a group.

Author

N. Frerebeau

See Also

Other grouping methods: group(), group_extract(), group_split()

Examples

Run this code
## 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