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

Popular posts from this blog

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -