group_data.DataFrame: Grouping metadata

View source: R/dplyr.R

group_data.DataFrameR Documentation

Grouping metadata

Description

This collection of functions accesses data about grouped data frames in various ways:

  • group_data() returns a data frame that defines the grouping structure. The columns give the values of the grouping variables. The last column, always called .rows, is a list of integer vectors that gives the location of the rows in each group.

  • group_keys() returns a data frame describing the groups.

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

  • group_indices() returns an integer vector the same length as .data that gives the group that each row belongs to.

  • group_vars() gives names of grouping variables as character vector.

  • groups() gives the names of the grouping variables as a list of symbols.

  • group_size() gives the size of each group.

  • n_groups() gives the total number of groups.

See context for equivalent functions that return values for the current group.

Usage

## S3 method for class 'DataFrame'
group_data(.data)

Arguments

.data

a S4Vectors::DataFrame()

Value

a data.frame of group data


jonocarroll/DFplyr documentation built on Oct. 16, 2024, 4:56 a.m.