averages | R Documentation |
Calculates a number of different types of averages for a vector.
averages(
x,
trim = 0.1,
types = c("arithmetic", "geometric", "harmonic", "mode", "median", "trimmed",
"midrange")
)
x |
(num vectr) A vector of values. |
trim |
(num vectr) Used for trimmed means. Default = .10. |
types |
(chr vectr) Which types of averages to calculate? |
#simualte some data
set.seed(1)
x = sample(1:10, replace = T, size = 1000, prob = seq(.1, .5, length.out = 10))
#look at it
GG_denhist(x, vline = NULL)
#calcualte averages
averages(x)
#normal data
set.seed(1)
averages(rnorm(1000)) #some functions give warnings when there are negative numbers
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.