-
Notifications
You must be signed in to change notification settings - Fork 417
Closed
Labels
featurea feature request or enhancementa feature request or enhancementpivoting ♻️pivot rectangular data to different "shapes"pivot rectangular data to different "shapes"
Description
uncount()
currently works with non-integer weights where it probably should not. Also the error message for negative weights is quite unclear.
library(tidyr)
# no error
tibble(x = c("a", "b"), n = c(1, 0.5)) %>%
uncount(n)
#> # A tibble: 1 x 1
#> x
#> <chr>
#> 1 a
# unclear error message
tibble(x = c("a", "b"), n = c(1, -1)) %>%
uncount(n)
#> Error in rep(seq_nrow(data), w): invalid 'times' argument
Created on 2020-12-07 by the reprex package (v0.3.0)
Metadata
Metadata
Assignees
Labels
featurea feature request or enhancementa feature request or enhancementpivoting ♻️pivot rectangular data to different "shapes"pivot rectangular data to different "shapes"