scale_weights | R Documentation |
Scale a vector of weights so that they sum to 1.
scale_weights(x)
x |
A strictly positive numeric vector. |
A numeric vector that sums to 1. If there are NA
s in x
then the result
sums 1 to if these values are removed.
grouped()
to make this function applicable to grouped data.
Other weights functions:
factor_weights()
,
transmute_weights()
scale_weights(1:5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.