We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
crossing() seems to ignore NA values. This is inconvenient and not consistent with expand.grid(). Reprex:
crossing()
expand.grid()
library(tidyr) crossing(num = 1:2, char = c("A", "B", NA)) #> # A tibble: 4 x 2 #> num char #> <int> <chr> #> 1 1 A #> 2 1 B #> 3 2 A #> 4 2 B expand.grid(num = 1:2, char = c("A", "B", NA)) #> num char #> 1 1 A #> 2 2 A #> 3 1 B #> 4 2 B #> 5 1 <NA> #> 6 2 <NA>
Other ‘special’ values work fine:
crossing(num = 1:2, char = c("A", "B", NaN)) #> # A tibble: 6 x 2 #> num char #> <int> <chr> #> 1 1 A #> 2 1 B #> 3 1 NaN #> 4 2 A #> 5 2 B #> 6 2 NaN crossing(num = 1:2, char = c("A", "B", Inf)) #> # A tibble: 6 x 2 #> num char #> <int> <chr> #> 1 1 A #> 2 1 B #> 3 1 Inf #> 4 2 A #> 5 2 B #> 6 2 Inf
The text was updated successfully, but these errors were encountered:
Root cause is:
ulevels(c("A", "B", NA)) #> [1] "A" "B"
Sorry, something went wrong.
Root cause of that is
sort(c("A", "B", NA)) #> [1] "A" "B"
1dc4066
No branches or pull requests
crossing()
seems to ignore NA values. This is inconvenient and not consistent withexpand.grid()
. Reprex:Other ‘special’ values work fine:
The text was updated successfully, but these errors were encountered: