Performs the opposite operation to `dplyr::count()`, duplicating rows according to a weighting variable (or expression). Analogous to `tidyr::uncount`.
uncount_dt(.data, wt, .remove = TRUE)
| .data | A data.frame |
|---|---|
| wt | A vector of weights. |
| .remove | Should the column for |
#> x #> <char> #> 1: a #> 2: b #> 3: buncount_dt(df,n,FALSE)#> x n #> <char> <num> #> 1: a 1 #> 2: b 2 #> 3: b 2