weight2rows | R Documentation |
Present since v1.0.0
.
Argument rows.out
available since v1.3.0
;
rows.out < 1
supported since v 1.4.0
.
Argument discard_weight.var
available since v1.3.0
.
weight2rows(DT, weight.var, rows.out = NULL, discard_weight.var = FALSE)
DT |
A |
weight.var |
Variable in |
rows.out |
If not Since |
discard_weight.var |
If |
DT
but with the number of rows expanded to sum(DT[[weight.var]])
to reflect the weighting.
library(data.table) DT <- data.table(x = 1:5, y = c(1, 1, 1, 1, 2)) weight2rows(DT, "y") weight2rows(DT, "y", rows.out = 5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.