R/f_mutate.R

Defines functions f_mutate

Documented in f_mutate

#' A faster `mutate()` with per-group optimisations
#'
#' @inheritParams f_summarise
#' @param .keep Which columns to keep. Options are 'all', 'used', 'unused' and
#' 'none'.
#'
#' @inheritSection f_summarise Details
#'
#' @returns
#' A data frame with added columns.

#' @export
f_mutate <- function(.data, ...,  .by = NULL, .order = group_by_order_default(.data), .keep = "all"){
  mutate_summary(.data, ..., .keep = .keep, .order = .order, .by = {{ .by }})[["data"]]
}

Try the fastplyr package in your browser

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

fastplyr documentation built on June 8, 2025, 11:18 a.m.