Description Usage Arguments See Also

View source: R/2statsHelpers.R

Computes a weighted mean of a numeric vector.

1 | ```
weightedMean(x, w, na.rm = TRUE)
``` |

`x` |
a numeric vector containing the values whose weighted mean is to be computed. |

`w` |
a vector of weights the same length as x giving the weights to use for each element of x. Negative weights are treated as zero weights. Default value is equal weight to all values.# |

`na.rm` |
a logical value indicating whether NA values in x should be stripped before the computation proceeds, or not. If NA, no check at all for NAs is done. Default value is NA (for efficiency). |

Other "central tendency functions":
`weightedCount`

,
`weightedMedian`

, `weightedSum`

Other stats helper functions: `allNA`

,
`allNull`

, `is.yesno`

,
`qType`

, `reorderQuestion`

,
`reorderResponse`

,
`splitBinCombine`

,
`splitMeanCombine`

,
`splitPercentCombine`

,
`weightedCount`

,
`weightedMedian`

, `weightedSum`

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.