mutateX: mutateX

Description Usage Arguments Value Examples

View source: R/tidyverse-extras.R

Description

mutate which replaces X with the name of the assigned column.

Usage

1
mutateX(.data, ..., .varX = "X")

Arguments

.data

A tbl.

...

Name-value pairs of expressions.

.varX

What to use as a substitute.

Value

An object of the same class as .data.

Examples

1
2
3
4
5
6
7
data <- data.frame(some_var = 1:100)
mutateX(data, some_var = ifelse(X > 10, 10, X), noChange = some_var + 1)
# Or in vanilla mutate:
library(dplyr)
data <- data.frame(some_var = 1:100)
mutate(data, some_var = ifelse(some_var > 10, 10, some_var),
       noChange = some_var + 1)

Ottawa-EPRI/EPmisc documentation built on May 18, 2019, 10:14 a.m.