Description Usage Arguments Value Examples
View source: R/tidyverse-extras.R
mutate which replaces X with the name of the assigned column.
1 |
.data |
A tbl. |
... |
Name-value pairs of expressions. |
.varX |
What to use as a substitute. |
An object of the same class as .data.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.