Skip to content
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

left_join. not working as expected when column names are the same #397

Closed
russellhz opened this issue Mar 30, 2022 · 1 comment · Fixed by #398
Closed

left_join. not working as expected when column names are the same #397

russellhz opened this issue Mar 30, 2022 · 1 comment · Fixed by #398
Labels
bug Something isn't working

Comments

@russellhz
Copy link

russellhz commented Mar 30, 2022

I am trying to join two tables with the same column names:

a <- data.table(year = 1:5, value = 1:5)
b <- data.table(year = 1:5, value = 6:10)
left_join.(a, b, by = c("year"))

In dplyr, this would results in a tibble with the columns year, value.x, and value.y.

Instead this is just returning a back to me with the columns year and value

Thanks in advance for any help on this!

@markfairbanks
Copy link
Owner

All fixed - thanks for catching this!

# devtools::install_github("markfairbanks/tidytable")
library(tidytable, warn.conflicts = FALSE)
a <- data.table(year = 1:5, value = 1:5)
b <- data.table(year = 1:5, value = 6:10)
left_join.(a, b, by = c("year"))
#> # A tidytable: 5 × 3
#>    year value.x value.y
#>   <int>   <int>   <int>
#> 1     1       1       6
#> 2     2       2       7
#> 3     3       3       8
#> 4     4       4       9
#> 5     5       5      10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants