-
Notifications
You must be signed in to change notification settings - Fork 33
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
expand.(): Cannot yet handle negatives #282
Comments
Interesting - I didn't know that Should be a relatively easy fix - I'll switch over to using |
That would be great. Thanks! |
reprex pacman::p_load(tidytable)
test_df <- tidytable(x = c(1, 1, 2), y = c(1, 1, 2))
test_df %>%
expand.(nesting.(x, y), z = c(-1.0, 1.0))
#> Error in fsort(x, decreasing = decreasing, na.last = na.last): Cannot yet handle negatives. |
Also I noticed in your example above you were using pacman::p_load(tidytable, tidyverse)
data_size <- 1000000
test_df <- tidytable(
x = sample(1:100, data_size, TRUE),
y = sample(letters, data_size, TRUE)
)
bench::mark(
tidytable_nesting = test_df %>% expand.(nesting.(x, y)),
tidyr_nesting = test_df %>% expand.(nesting(x, y))
) %>%
select.(expression, median)
#> # A tidytable: 2 × 2
#> expression median
#> <bch:expr> <bch:tm>
#> 1 tidytable_nesting 8.77ms
#> 2 tidyr_nesting 22.58ms |
Oh wow, I didn't notice that! Great tip. |
Fixed! Thanks for catching this 👍 I'll submit the new version of tidytable to CRAN in the next few days so it will be fixed there as well. library(tidytable)
test_df <- tidytable(x = c(1, 1, 2), y = c(1, 1, 2))
test_df %>%
expand.(nesting.(x, y), z = c(-1.0, 1.0))
#> # A tidytable: 4 × 3
#> x y z
#> <dbl> <dbl> <dbl>
#> 1 1 1 -1
#> 2 1 1 1
#> 3 2 2 -1
#> 4 2 2 1 |
Hi, tidytable has changed the way I wrangle my data.
Unfortunately, I'm having issues using expand.() probably because my vector contains negative values.
"expand.(nesting(a3,b3,sig3),log_pred_mass = seq(-20,20,0.2))
Error in fsort(x, decreasing = decreasing, na.last = na.last) :
Cannot yet handle negatives."
Do you have any idea when it will handle negative values?
Thank you!
The text was updated successfully, but these errors were encountered: