r - How to calculate a mean value from multiple maximal values -
r - How to calculate a mean value from multiple maximal values -
i have variable e.g. c(0, 8, 7, 15, 85, 12, 46, 12, 10, 15, 15)
how can calculate mean value out of random maximal values in r?
for example, calculate mean value 3 maximal values?
first step: draw sample of 3 info , store in x second step: calculate mean of sample
try
dat <- c(0,8,7,15, 85, 12, 46, 12, 10, 15,15) x <- sample(dat,3) x mean(x)
possible output:
> x <- sample(dat,3) > x [1] 85 15 0 > mean(x) [1] 33.33333
r max
Comments
Post a Comment