Learn R Programming

rquery (version 0.2.0)

execute_data_frame: Attempt to execute a pipeline (assuming it has local data, or is passed local data).

Description

Attempt to execute a pipeline (assuming it has local data, or is passed local data).

Usage

execute_data_frame(node_tree, ..., env = parent.frame(), data = NULL,
  result_limit = NULL)

Arguments

node_tree

rquery relop pipeline.

...

force later arguments to bind by name.

env

environment to work in.

data

data.frame to evaluate.

result_limit

numeric if not null limit result to this many rows.

Value

executed pipleline or NULL if not executable.

Examples

Run this code
# NOT RUN {
winvector_temp_db_handle <- list(
  db = DBI::dbConnect(RSQLite::SQLite(), ":memory:")
)
RSQLite::initExtension(winvector_temp_db_handle$db)

d <- data.frame(AUC = 0.6, R2 = c(0.1, 0.2), D = NA, z = 2)
q <- table_source("d", c("AUC", "R2", "D")) %.>%
	extend_nse(., c := sqrt(R2)) %.>%
  orderby(., "R2", desc = TRUE)

rquery_apply_to_data_frame(d, q)

execute_data_frame(q, data = d)

d %.>% q
# run (and build result for) ad-hoc query
d %.>%
  extend_nse(., c := sqrt(R2)) %.>%
  orderby(., "R2", desc = TRUE) %.>%
  execute_data_frame(.)
# print ad-hoc query (result only available for printing)
d %.>%
  extend_nse(., c := sqrt(R2)) %.>%
  orderby(., "R2", desc = TRUE)

DBI::dbDisconnect(winvector_temp_db_handle$db)
winvector_temp_db_handle <- NULL

# }

Run the code above in your browser using DataLab