Description Usage Arguments Value Examples
Calculates an average vector from rows of multiple vectors
1 | average_vector(x, fun = "mean", ...)
|
x |
Matrix of numerical data. Columns are components of the data, row per vector |
fun |
function to use, current options: mean, median |
... |
additional arguments to be passed to fun |
Mean vector
1 2 3 4 | x <- matrix(c(1,5,2,10,3,10), ncol = 2)
average_vector(x)
average_vector(x, fun = "median")
average_vector(x, fun = "median", na.rm = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.