c_across: Combine values from multiple columns

View source: R/c_across.R

c_acrossR 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)))

tidytable documentation built on Sept. 11, 2024, 8:05 p.m.