transmute: Add new variables and drop all others

View source: R/transmute.R

transmuteR Documentation

Add new variables and drop all others

Description

Unlike mutate(), transmute() keeps only the variables that you create

Usage

transmute(.df, ..., .by = NULL)

Arguments

.df

A data.frame or data.table

...

Columns to create/modify

.by

Columns to group by

Examples

df <- data.table(
  a = 1:3,
  b = 4:6,
  c = c("a", "a", "b")
)

df %>%
  transmute(double_a = a * 2)

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