c_across.: Combine values from multiple columns

c_across.R Documentation

Combine values from multiple columns

Description

c_across() works inside of mutate_rowwise(). It uses tidyselect so you can easily select multiple variables.

Usage

c_across.(cols = everything())

Arguments

cols

Columns to transform.

Examples

df <- data.table(x = runif(6), y = runif(6), z = runif(6))

df %>%
  mutate_rowwise(row_mean = mean(c_across(x:z)))

mtfairbanks/gdt documentation built on Dec. 3, 2022, 6:50 a.m.