R/mutate_cond.R
mutate_cond.Rd
A conditional mutate function that allows you to mutate a variable based on another
mutate_cond(.data, condition, ..., envir = parent.frame())
.data, | the data frame or tibble you want to mutate a column in |
---|---|
x | The column you want to test for a logical condition |
y | The coloumn you want to mutate based on logic from column x |
mutate_cond(df, x == 1, y == "c" )#> Error in eval(substitute(condition), .data, envir): invalid 'envir' argument of type 'closure'