mutate_se: mutate standard evaluation interface.

Description Usage Arguments Details Value See Also Examples

View source: R/mutate_se.R

Description

Mutate a data frame by the mutateTerms. Accepts arbitrary text as mutateTerms to allow forms such as "Sepal.Length >= 2 * Sepal.Width". Terms are vectors or lists of the form "lhs := rhs". Semantics are: terms are evaluated left to right if splitTerms==TRUE (the default).

Usage

1
2
3
4
5
6
7
8
9
mutate_se(
  .data,
  mutateTerms,
  ...,
  splitTerms = TRUE,
  warn = TRUE,
  env = parent.frame(),
  printPlan = FALSE
)

Arguments

.data

data.frame

mutateTerms

character vector of column expressions to mutate by.

...

force later terms to be bound by name

splitTerms

logical, if TRUE into separate mutates (if FALSE instead, pass all at once to dplyr).

warn

logical, if TRUE warn about name re-use.

env

environment to work in.

printPlan

logical, if TRUE print the expression plan.

Details

Note: this method as the default setting splitTerms = TRUE, which is safer (avoiding certain known dplyr/dblyr issues) (please see the side-notes of https://winvector.github.io/FluidData/partition_mutate.html for some references).

Value

.data with altered columns.

See Also

mutate_nse, mutate, mutate_at, :=

Examples

1
2
3
4
5
6
limit <- 3.5

datasets::iris %.>%
  mutate_se(., qae(Sepal_Long = Sepal.Length >= 2 * Sepal.Width,
                   Petal_Short := Petal.Length <= limit)) %.>%
  head(.)

seplyr documentation built on Sept. 5, 2021, 5:12 p.m.