ex_data_table: Execute an 'rquery' pipeline with 'data.table' sources.

Description Usage Arguments Details Value Examples

View source: R/rquery_fns.R

Description

data.tables are looked for by name in the tables argument and in the execution environment. Main external execution interface.

Usage

1
2
3
4
5
6
7
8
ex_data_table(
  optree,
  ...,
  tables = list(),
  source_usage = NULL,
  source_limit = NULL,
  env = parent.frame()
)

Arguments

optree

relop operations tree.

...

not used, force later arguments to bind by name.

tables

named list map from table names used in nodes to data.tables and data.frames.

source_usage

list mapping source table names to vectors of columns used.

source_limit

if not null limit all table sources to no more than this many rows (used for debugging).

env

environment to work in.

Details

Value

resulting data.table (intermediate tables can somtimes be mutated as is practice with data.table).

Examples

1
2
3
4
5
6
7
8
9
  a <- data.table::data.table(x = c(1, 2) , y = c(20, 30), z = c(300, 400))
  optree <- local_td(a) %.>%
     select_columns(., c("x", "y")) %.>%
     select_rows_nse(., x<2 & y<30)
  cat(format(optree))
  ex_data_table(optree)

  # other ways to execute the pipeline include
  data.frame(x = 0, y = 4, z = 400) %.>% optree

rqdatatable documentation built on Jan. 23, 2022, 1:06 a.m.