df_a <- data.frame(A = 1:3, B = c("a", "b", "c"))
names(df_a) <- c("AA")
df_b <- data.frame(A = 2:4, C = c("aa", "bb", "cc"))
names(df_b) <- c("AA")
df_ab <- dplyr::full_join(df_a, df_b, by = "AA")
Error: Column 2 must be named
df_a <- tibble::tibble(A = 1:3, B = c("a", "b", "c"))
names(df_a) <- c("AA")
df_b <- tibble::tibble(A = 2:4, C = c("aa", "bb", "cc"))
names(df_b) <- c("AA")
df_ab <- dplyr::full_join(df_a, df_b, by = "AA")
(It also crashes with base::data.frame())
Could you please turn this into a self-contained reprex (short for minimal reproducible example)? It will help us help you if we can be sure we're all working with/looking at the same stuff.
If you've never heard of a reprex before, you might want to start by reading the tidyverse.org help page. The reprex dos and don'ts are also useful.
I've updated the post, let me know if it is ok now?
(first time doing this)
Hi @JLYJabc,
OK, so I sent you on a bit of a goose chase, because (since it causes a crash, or, for me, an endless process), it's un-reprex-able.
So, here's a lengthy reprex, printing all but that final step (which isn't in the reprex because, well, see above).
df_a <- data.frame(A = 1:3, B = c("a", "b", "c"))
df_a
#> A B
#> 1 1 a
#> 2 2 b
#> 3 3 c
names(df_a) <- c("AA")
df_a
#> AA NA
#> 1 1 a
#> 2 2 b
#> 3 3 c
df_b <- data.frame(A = 2:4, C = c("aa", "bb", "cc"))
df_b
#> A C
#> 1 2 aa
#> 2 3 bb
#> 3 4 cc
names(df_b) <- c("AA")
df_b
#> AA NA
#> 1 2 aa
#> 2 3 bb
#> 3 4 cc
df_ab <- dplyr::full_join(df_a, df_b, by = "AA")
#> Error: Column 2 must be named
df_a <- tibble::tibble(A = 1:3, B = c("a", "b", "c"))
names(df_a) <- c("AA")
df_a
#> # A tibble: 3 x 2
#> AA `NA`
#> <int> <chr>
#> 1 1 a
#> 2 2 b
#> 3 3 c
df_b <- tibble::tibble(A = 2:4, C = c("aa", "bb", "cc"))
names(df_b) <- c("AA")
df_b
#> # A tibble: 3 x 2
#> AA `NA`
#> <int> <chr>
#> 1 2 aa
#> 2 3 bb
#> 3 4 cc
Created on 2018-03-13 by the reprex package (v0.2.0).
After this, the line below ⇨ wonkiness…
df_ab <- dplyr::full_join(df_a, df_b, by = "AA")
I don't have a solution yet, just reproducing for now!
I can reproduce the endlessness.
I'm working on it as part of #3307.
In 0.7.4 I'm seeing dplyr caught in an endless loop with the original example. This means we can safely raise an error here without breaking "compatibility".
This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/
Most helpful comment
I'm working on it as part of #3307.