Learn R Programming

replyr (version 0.8.2)

bind_rowsQ: Bind rows by a query. Assumes all tables structured identically.

Description

Bind rows by a query. Assumes all tables structured identically.

Usage

bind_rowsQ(tableNames, colNames, my_db,
  tempNameGenerator = makeTempNameGenerator("bind_rowsQ"), ...,
  origTableColumn = NULL)

Arguments

tableNames

names of tables to concatinate (not empty)

colNames

names of columns

my_db

connection to where tables live

tempNameGenerator

temp name generator produced by replyr::makeTempNameGenerator, used to record dplyr::compute() effects.

...

force later arguments to bind by name

origTableColumn

character, column to put original table name in.

Examples

Run this code
# NOT RUN {
my_db <- DBI::dbConnect(RSQLite::SQLite(), ":memory:")
tempNameGenerator = makeTempNameGenerator("bind_rowsQ_demo")
d1 <- replyr_copy_to(my_db, data.frame(x=1:2, y= 10:11), 'd1')
d2 <- replyr_copy_to(my_db, data.frame(x=3:4, y= 13:14), 'd2')
bind_rowsQ(c('d1', 'd2'), c('x', 'y'), my_db,
           tempNameGenerator = tempNameGenerator,
           origTableColumn = 'orig_table')

# }

Run the code above in your browser using DataLab