Learn R Programming

nexus (version 0.6.0)

is_assigned: Grouped Data

Description

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

Usage

is_assigned(object)

any_assigned(object)

all_assigned(object)

# S4 method for ReferenceGroups is_assigned(object)

# S4 method for ReferenceGroups any_assigned(object)

# S4 method for ReferenceGroups all_assigned(object)

Value

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

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

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

Arguments

object

A grouped R object.

Author

N. Frerebeau

See Also

Other grouping methods: group(), group_names(), group_split(), group_subset()

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_n(coda)

group_size(coda)

Run the code above in your browser using DataLab