DRDataRaft/ docs
GitHub ↗

dr_step_transform()

Add a deferred preparation step

Usage

dr_step_transform(x, transform, name = NULL)

dr_step_mutate(x, ...)

dr_step_filter(x, ..., .by = NULL, .preserve = FALSE)

dr_step_select(x, ...)

dr_step_rename(x, ...)

dr_step_arrange(x, ...)

dr_step_summarise(x, ..., .by = NULL, .groups = NULL)

dr_step_distinct(x, ..., .keep_all = FALSE)

Arguments

x
A dr_recipe() specification.


transform
Function, formula using .x, or transformation adapter.


name
Optional unique step name for dr_step_transform().


...
Arguments passed to the corresponding dplyr verb at execution.


.by, .preserve, .groups, .keep_all
Arguments with their dplyr meanings.

Value

An updated recipe. The original is unchanged.

Available steps



Use dr_step_mutate() and dr_step_rename() to change columns; dr_step_filter() and dr_step_select() to select rows and columns; dr_step_arrange() and dr_step_distinct() to order and deduplicate; and dr_step_summarise() to aggregate.

Execution



Steps execute in addition order using the existing dplyr and transformation adapters. No implicit collection is performed. Use dr_step_transform() for an ordinary function, formula using .x, or an existing transform adapter. It also accepts an engine-configured dr_lookup_spec().

Examples

dr_recipe() |>
  dr_step_mutate(net = gross / 1.19) |>
  dr_step_select(id, net)
Documentation source snapshot · View source at d9cb454 ↗
Code examples are documented source examples; they are not executed in this website build.

Search documentation

Search functions, packages and guides.