replyr_bind_rows: Bind a list of items by rows (can't use dplyr::bind_rows or...

Description Usage Arguments Value Examples

View source: R/bind_rows.R

Description

Bind a list of items by rows (can't use dplyr::bind_rows or dplyr::combine on remote sources). Columns are intersected.

Usage

1
2
3
replyr_bind_rows(lst, ..., useDplyrLocal = TRUE, useSparkRbind = TRUE,
  useUnionALL = TRUE,
  tempNameGenerator = mk_tmp_name_source("replyr_bind_rows"))

Arguments

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.

Value

single data item

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
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)
}

replyr documentation built on Nov. 1, 2019, 7:49 p.m.