R/group_cols.R

Defines functions group_cols

Documented in group_cols

#' Selection helper for grouping columns
#'
#' @description
#' Selection helper for grouping columns
#'
#' @export
#'
#' @examples
#' df <- tidytable(
#'   x = c("a", "b", "c"),
#'   y = 1:3,
#'   z = 1:3
#' )
#'
#' df %>%
#'   group_by(x) %>%
#'   select(group_cols(), y)
group_cols <- function() {
  all_of(group_vars(peek_data()))
}

Try the tidytable package in your browser

Any scripts or data that you put into this service are public.

tidytable documentation built on Oct. 5, 2023, 5:07 p.m.