R/bind_rows.R
replyr_bind_rows.Rd
Bind a list of items by rows (can't use dplyr::bind_rows or dplyr::combine on remote sources). Columns are intersected.
replyr_bind_rows( lst, ..., useDplyrLocal = TRUE, useSparkRbind = TRUE, useUnionALL = TRUE, tempNameGenerator = mk_tmp_name_source("replyr_bind_rows") )
lst | list of items to combine, must be all in same dplyr data service |
---|---|
... | force other arguments to be used by name |
useDplyrLocal | logical if TRUE use dplyr for local data. |
useSparkRbind | logical if TRUE try to use rbind on Sparklyr data |
useUnionALL | logical if TRUE try to use union all binding |
tempNameGenerator | temp name generator produced by wrapr::mk_tmp_name_source, used to record dplyr::compute() effects. |
single data item
if (requireNamespace("RSQLite", quietly = TRUE)) { my_db <- DBI::dbConnect(RSQLite::SQLite(), ":memory:") # my_db <- sparklyr::spark_connect(master = "local") d <- replyr_copy_to(my_db, data.frame(x = 1:2), 'd', temporary = TRUE) # dplyr::bind_rows(list(d, d)) # # Argument 1 must be a data frame or a named atomic vector, # # not a tbl_dbi/tbl_sql/tbl_lazy/tbl print(replyr_bind_rows(list(d, d))) DBI::dbDisconnect(my_db) }#> # Source: lazy query [?? x 1] #> # Database: sqlite 3.30.1 [:memory:] #> x #> <int> #> 1 1 #> 2 2 #> 3 1 #> 4 2