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

Deprecate cross() and cross_df() #768

Closed
lionel- opened this issue Jun 5, 2020 · 0 comments
Closed

Deprecate cross() and cross_df() #768

lionel- opened this issue Jun 5, 2020 · 0 comments
Labels
breaking change ☠️ API change likely to affect existing code

Comments

@lionel-
Copy link
Member

lionel- commented Jun 5, 2020

There is tidyr::expand_grid() which doesn't have these issues. The ordering of combinations is not the same, but probably not a big deal:

data <- list(
  id = c("John", "Jane"),
  greeting = c("Hello.", "Bonjour."),
  sep = c("! ", "... ")
)

data %>%
  cross() %>%
  map_chr(lift(paste))
#> [1] "John! Hello."     "Jane! Hello."     "John! Bonjour."   "Jane! Bonjour."
#> [5] "John... Hello."   "Jane... Hello."   "John... Bonjour." "Jane... Bonjour."

tidyr::expand_grid(!!!data) %>%
  pmap_chr(paste)
#> [1] "John! Hello."     "John... Hello."   "John! Bonjour."   "John... Bonjour."
#> [5] "Jane! Hello."     "Jane... Hello."   "Jane! Bonjour."   "Jane... Bonjour."
@lionel- lionel- added the breaking change ☠️ API change likely to affect existing code label Jun 5, 2020
@lionel- lionel- closed this as completed in fa5c7c9 Aug 5, 2020
jpdunc23 referenced this issue in Yu-Group/simChef Dec 28, 2022
christianrickert added a commit to christianrickert/phenoptrReports that referenced this issue Nov 5, 2023
```
── Warning (test_smoke.R:136:3): file generation works ─────────────────────────
`cross2()` was deprecated in purrr 1.0.0.
i Please use `tidyr::expand_grid()` instead.
i See <tidyverse/purrr#768>.
```
christianrickert added a commit to christianrickert/phenoptr that referenced this issue Nov 10, 2023
```
-- Warning (test_average_counts.R:87:3): count_within_many works ---------------
`cross()` was deprecated in purrr 1.0.0.
i Please use `tidyr::expand_grid()` instead.
i See <tidyverse/purrr#768>.
Backtrace:
    x
 1. \-phenoptr::count_within_many(...) at test_average_counts.R:87:3
 2.   \-purrr::cross(list(pair = pairs, category = category))
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change ☠️ API change likely to affect existing code
Projects
None yet
Development

No branches or pull requests

1 participant