partition_mutate_qt: Partition a sequence of mutate commands into longest ordered...

Description Usage Arguments Details Value Examples

View source: R/stmtPlanner.R

Description

We assume the sequence of expressions is in a valid order (all items available before use). This function partitions the expressions into ordered longest "no new value used blocks" by greedily scanning forward remaining expressions in order taking any that: have all their values available from earlier groups, do not use a value formed in the current group, and do not overwrite a value formed in the current group. For an example please see https://winvector.github.io/FluidData/partition_mutate.html.

Usage

1

Arguments

...

mutate expressions with := used for assignment.

Details

Note: unlike mutate_nse partition_mutate_qt does not perform substitutions.

Value

ordered list of mutate_se assignment blocks

Examples

1
2
3
4
plan <- partition_mutate_qt(a1 := 1, b1 := a1, a2 := 2, b2 := a1 + a2)
print(plan)
d <- data.frame(x = 1) %.>% mutate_seb(., plan)
print(d)

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