Skip to contents

group_vars() returns a character vector with the names of the grouping variables. group_keys() returns a data frame with one row per group.

Usage

# S3 method for class 'RPolarsDataFrame'
group_vars(x)

# S3 method for class 'RPolarsLazyFrame'
group_vars(x)

# S3 method for class 'RPolarsDataFrame'
group_keys(.tbl, ...)

# S3 method for class 'RPolarsLazyFrame'
group_keys(.tbl, ...)

Arguments

x, .tbl

A Polars Data/LazyFrame

...

Not used.

Examples

pl_g <- polars::as_polars_df(mtcars) |>
  group_by(cyl, am)

group_vars(pl_g)
#> [1] "cyl" "am" 

group_keys(pl_g)
#>   cyl am
#> 1   4  0
#> 2   4  1
#> 3   6  0
#> 4   6  1
#> 5   8  0
#> 6   8  1