Description Usage Arguments Details Value Examples
This function computes the arithmetic mean of a numerical vector.
1 | ma_function(x, na_rm = FALSE)
|
x |
a numerical vector (can contain 'NA' values). |
na_rm |
a logical value indicating whether 'NA' values should be stripped before the computation proceeds. |
An error will be returned if 'x' contains 'NA' values and 'na_rm' is set to 'FALSE' or if 'x' contains less than two values (after removing 'NA').
The arithmetic mean of the values as a numeric vector of length one.
1 2 3 | ma_function(1:10)
{
ma_function(c(1:10, NA)) # Error
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.