-
Notifications
You must be signed in to change notification settings - Fork 420
Closed
Labels
bugan unexpected problem or unintended behavioran unexpected problem or unintended behaviorgrids #️⃣expanding, nesting, crossing, ...expanding, nesting, crossing, ...
Description
I am trying to create a tibble that contains all combinations of its elements, except for some nesting. In doing so, I encountered the following sensitivity of expand_grid with respect to its contents.
Is this a bug?
tidyr::expand_grid(
dplyr::tibble(
fruit = c("Apple", "Banana"),
fruit_id = c("a", "b")
),
dplyr::tibble(
status_id = c("c", "d"),
status = c("cut", "devoured")
)
)
#> # A tibble: 4 x 4
#> fruit fruit_id status_id status
#> <chr> <chr> <chr> <chr>
#> 1 Apple a c cut
#> 2 Apple a d devoured
#> 3 Banana b c cut
#> 4 Banana b d devoured
tidyr::expand_grid(
dplyr::tibble(
fruit = c("Apple", "Banana"),
fruit_id = c("a", "b")
),
dplyr::tibble(
status_id = c("c", "d"),
status = c("cut_neatly", "devoured"),
)
)
#> Error: Column name `dplyr::tibble(...)` must not be duplicated.
#> Use .name_repair to specify repair.Created on 2021-04-27 by the reprex package (v1.0.0)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugan unexpected problem or unintended behavioran unexpected problem or unintended behaviorgrids #️⃣expanding, nesting, crossing, ...expanding, nesting, crossing, ...