calc_weights | R Documentation |
Calculate (simple) weights based on the proportion of another variable.
calc_weights(data, weight_var, target, weight_label = "weight")
data |
Data frame or tibble containing the variable used for computing weights |
weight_var |
The variable to be used for computing the weight |
target |
A named vector containing the target weights. Names must mtach labels for |
weight_label |
A character vector to specify the variable name of the weight variable. Defaults to 'weight'. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.