-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Open
Labels
featurea feature request or enhancementa feature request or enhancementrows ↕️Operations on rows: filter(), slice(), arrange()Operations on rows: filter(), slice(), arrange()
Description
It would be nice if bind_rows() would work for database tables.
library(dplyr, warn.conflicts = FALSE)
library(purrr)
con <- DBI::dbConnect(RSQLite::SQLite(), ":memory:")
# Create random slices of mtcars
tables <-
1:5 |>
map(function(n) {
tbl_name <- paste0("mtcars_", n)
copy_to(con, slice_sample(mtcars, n = 3), tbl_name)
tbl(con, tbl_name)
})
bind_rows(!!!tables)
#> Error in `bind_rows()`:
#> ! Argument 1 must be a data frame or a named atomic vector.
#> Backtrace:
#> ▆
#> 1. └─dplyr::bind_rows(!!!tables)
#> 2. └─rlang::abort(glue("Argument {i} must be a data frame or a named atomic vector."))Created on 2023-08-07 with reprex v2.0.2
I know there were issues with the double dispatch and what happens if local tables and database tables are mixed.
But I think it would be sufficient if either all inputs are local tables or database tables.
This was also requested again in dbplyr: tidyverse/dbplyr#1342.
markfairbanks, fh-mthomson, mpthomson, moodymudskipper, etiennebacher and 2 moreavhz
Metadata
Metadata
Assignees
Labels
featurea feature request or enhancementa feature request or enhancementrows ↕️Operations on rows: filter(), slice(), arrange()Operations on rows: filter(), slice(), arrange()