-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Labels
featurea feature request or enhancementa feature request or enhancementtables 🧮joins and set operationsjoins and set operations
Description
Sometimes one wants a cross-join, but the obvious way to write that in dplyr
does not work (though it does work for dbplyr
).
suppressPackageStartupMessages(library("dplyr"))
#> Warning: package 'dplyr' was built under R version 3.5.2
packageVersion("dplyr")
#> [1] '0.8.0.1'
packageVersion("dbplyr")
#> [1] '1.3.0'
d <- data.frame(g = c("a", "b"),
stringsAsFactors = FALSE)
left_join(d, d, by = character(0))
#> Error: `by` must specify variables to join by
db <- DBI::dbConnect(RSQLite::SQLite(),
":memory:")
d2 <- dplyr::copy_to(db, d, "d2")
left_join(d2, d2, by = character(0))
#> # Source: lazy query [?? x 2]
#> # Database: sqlite 3.22.0 [:memory:]
#> g.x g.y
#> <chr> <chr>
#> 1 a a
#> 2 a b
#> 3 b a
#> 4 b b
DBI::dbDisconnect(db)
Created on 2019-02-20 by the reprex package (v0.2.1)
Metadata
Metadata
Assignees
Labels
featurea feature request or enhancementa feature request or enhancementtables 🧮joins and set operationsjoins and set operations
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
romainfrancois commentedon Mar 4, 2019
joins are not part of our immediate focus for the next series. This is probably something that can be incubated in another package for the time being.
hadley commentedon Jan 11, 2020
In the join refactoring I'm working on currently, this turns out to be a trivial fix so it's likely to make it in 1.0.0
Implement inner_join.data.frame using new approach
Rewrite all join functions (#4741)