Uncount a data.table
uncount(.df, weights, .remove = TRUE, .id = NULL)
df <- data.table(x = c("a", "b"), n = c(1, 2))
uncount(df, n)
#> # A tidytable: 3 × 1
#> x
#> <chr>
#> 1 a
#> 2 b
#> 3 b
uncount(df, n, .id = "id")
#> # A tidytable: 3 × 2
#> x id
#> <chr> <int>
#> 1 a 1
#> 2 b 1
#> 3 b 2