Concatenate tables by rows.
unionall(sources, env = parent.frame())
sources | list of relop trees or list of data.frames |
---|---|
env | environment to look to. |
order_by node or altered data.frame.
if (requireNamespace("DBI", quietly = TRUE) && requireNamespace("RSQLite", quietly = TRUE)) { my_db <- DBI::dbConnect(RSQLite::SQLite(), ":memory:") d <- rq_copy_to(my_db, 'd', data.frame(AUC = 0.6, R2 = 0.2)) optree <- unionall(list(d, d, d)) cat(format(optree)) sql <- to_sql(optree, my_db, limit = 2) cat(sql) print(DBI::dbGetQuery(my_db, sql)) DBI::dbDisconnect(my_db) }#> unionall(., #> mk_td("d", c( #> "AUC", #> "R2")), #> mk_td("d", c( #> "AUC", #> "R2")), #> mk_td("d", c( #> "AUC", #> "R2"))) #> SELECT `AUC`, `R2` FROM ( SELECT #> `AUC`, #> `R2` #> FROM #> `d` LIMIT 2 ) tsql_92762550672636713129_0000000000 UNION ALL SELECT `AUC`, `R2` FROM ( SELECT #> `AUC`, #> `R2` #> FROM #> `d` LIMIT 2 ) tsql_92762550672636713129_0000000001 UNION ALL SELECT `AUC`, `R2` FROM ( SELECT #> `AUC`, #> `R2` #> FROM #> `d` LIMIT 2 ) tsql_92762550672636713129_0000000002 LIMIT 2 #> AUC R2 #> 1 0.6 0.2 #> 2 0.6 0.2