Description Usage Arguments Value
View source: R/calc_weighted_mean.R
Takes a dataframe and calculates a weighted mean based on a chosen denominator and numerator column.
1 | calc_weighted_mean(data, numerator_col, denominator_col, multiplier = 1, ...)
|
data |
The data frame/table holding the information you'd like to calculate a weighted mean for |
numerator_col |
Value field that when aggregated will be the numerator in the calculation to work out weighted mean |
denominator_col |
Value field that when aggregated will be the denominator in the calculation to work out a weighted mean. |
multiplier |
A figure to divide your denominator by if your processing involves counting it multiple times. |
... |
Any columns you would like to group the data by when aggregating. |
A data frame containing the weighted mean for each group of data calculated.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.