apply_weights | R Documentation |
Internal function to apply the weights and perform some checks.
apply_weights(
data,
mapping,
weights,
fewcol,
manycol,
valuecol,
datacols,
weightcol
)
data |
a data.table. |
mapping |
a mapping between the aggregated categories and their parts. *All* aggregated categories in 'data' have to be part of the mapping. |
weights |
table with weights for disaggregation, the name of the column with the aggregated categories has to be 'manycol'. If columns (other than the column with the aggregated category) of the 'weights' coincide with columns of the data, the respective columns are considered when joining. |
fewcol |
name of the column containing aggregated categories. Default is "region". |
manycol |
name of the column containing dis-aggregated categories. Default is "iso". |
valuecol |
name of the column with the actual value to disaggregate, default is 'value'. |
datacols |
index columns that label categories which have to be treated seperately when dis-aggregating with a weight. |
weightcol |
column with the weights for the dis-aggregation, default is 'weight'. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.