-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Joins need to check that y
is a data.table
#14
Labels
Comments
The error message is not nice, but the following works as expected:
Low prio. |
This comment has been minimized.
This comment has been minimized.
Merged
Probably need some special case like: auto_copy_dt <- function(x, y) {
if (is.data.frame(y)) {
as.data.table(y)
} else {
dplyr::auto_copy(x, y, copy = copy)
}
} Latest reprex: library(dtplyr)
library(dplyr, warn.conflicts = FALSE)
dt <- data.table::data.table(x = 1:3, y = 3:1)
df <- data.frame(x = 3:1, z = 1:3)
anti_join(dt, df)
#> Joining, by = "x"
#> Error in `[.data.frame`(y, , by$y, with = FALSE): unused argument (with = FALSE)
left_join(dt, df)
#> Joining, by = "x"
#> Source: local data table [3 x 3]
#>
#> # A tibble: 3 x 3
#> x y z
#> <int> <int> <int>
#> 1 1 3 3
#> 2 2 2 2
#> 3 3 1 1 Created on 2019-06-13 by the reprex package (v0.2.1.9000) |
hadley
added
bug
an unexpected problem or unintended behavior
dplyr-compat 💞
dplyr compatibility issues
labels
Jun 13, 2019
Resolved with library(dplyr, warn.conflicts = FALSE)
library(dtplyr)
dt <- lazy_dt(data.table::data.table(x = 1:3, y = 3:1))
df <- data.frame(x = 3:1, z = 1:3)
anti_join(dt, df)
#> Joining, by = "x"
#> Source: local data table [?? x 2]
#> Call: `_DT1`[!`_DT2`, on = .(x)]
#>
#> # … with 2 variables: x <int>, y <int>
#>
#> # Use as.data.table()/as.data.frame()/as_tibble() to access results
left_join(dt, df)
#> Joining, by = "x"
#> Source: local data table [?? x 2]
#> Call: merge(`_DT1`, `_DT3`, all.x = TRUE, all.y = FALSE, by = "x")
#>
#> x y z
#> <int> <int> <int>
#> 1 1 3 3
#> 2 2 2 2
#> 3 3 1 1
#>
#> # Use as.data.table()/as.data.frame()/as_tibble() to access results Created on 2019-06-27 by the reprex package (v0.2.1.9000) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Moved from tidyverse/dplyr#1217, by @Helix123
The text was updated successfully, but these errors were encountered: