theta_join_se: Make a theta_join node.

View source: R/theta_join.R

theta_join_seR Documentation

Make a theta_join node.

Description

Theta join is a join on an arbitrary predicate.

Usage

theta_join_se(
  a,
  b,
  expr,
  ...,
  jointype = "INNER",
  suffix = c("_a", "_b"),
  env = parent.frame()
)

Arguments

a

source to select from.

b

source to select from.

expr

quoted join conditions

...

force later arguments to be by name

jointype

type of join ('INNER', 'LEFT', 'RIGHT', 'FULL').

suffix

character length 2, suffices to disambiguate columns.

env

environment to look for values in.

Value

theta_join node.

Examples


if (requireNamespace("DBI", quietly = TRUE) && requireNamespace("RSQLite", quietly = TRUE)) {
  my_db <- DBI::dbConnect(RSQLite::SQLite(), ":memory:")
  d1 <- rq_copy_to(my_db, 'd1',
                    data.frame(AUC = 0.6, R2 = 0.2))
  d2 <- rq_copy_to(my_db, 'd2',
                    data.frame(AUC2 = 0.4, R2 = 0.3))
  optree <- theta_join_se(d1, d2, "AUC >= AUC2")
  cat(format(optree))
  sql <- to_sql(optree, my_db)
  cat(sql)
  print(DBI::dbGetQuery(my_db, sql))
  DBI::dbDisconnect(my_db)
}


rquery documentation built on Aug. 20, 2023, 9:06 a.m.