Re: [R] Average of results coming from B=100 repetitions (looping)

2018-05-08 Thread varin sacha via R-help
Many thanks for all of you for your responses. Best Regards, SV Le mardi 8 mai 2018 à 21:58:37 UTC+2, Daniel Nordlund a écrit : On 5/8/2018 12:26 PM, varin sacha via R-help wrote: > >  Dear R-experts, > > Here below the reproducible example. I am trying to get the average of the

Re: [R] Average of results coming from B=100 repetitions (looping)

2018-05-08 Thread Daniel Nordlund
On 5/8/2018 12:26 PM, varin sacha via R-help wrote: Dear R-experts, Here below the reproducible example. I am trying to get the average of the 100 results coming from the "lst" function. I have tried lst$mean and mean(lst). It does not work. Any help would be highly appreciated > ##

Re: [R] Average of results coming from B=100 repetitions (looping)

2018-05-08 Thread Bert Gunter
mean(lst) ### See ?mean. A list cannot be an argument of mean. lst$mean ## nonsense! Don't guess -- read the docs. Here is an an example: > z <- list() > for(i in 1:5) z[i] <- i > z [[1]] [1] 1 [[2]] [1] 2 [[3]] [1] 3 [[4]] [1] 4 [[5]] [1] 5 > mean(z) [1] NA Warning message: In mean.default(

Re: [R] Average of results coming from B=100 repetitions (looping)

2018-05-08 Thread Eric Berger
mean(unlist(lst)) On Tue, May 8, 2018 at 10:26 PM, varin sacha via R-help < r-help@r-project.org> wrote: > > Dear R-experts, > > Here below the reproducible example. I am trying to get the average of the > 100 results coming from the "lst" function. I have tried lst$mean and > mean(lst). It doe

[R] Average of results coming from B=100 repetitions (looping)

2018-05-08 Thread varin sacha via R-help
Dear R-experts, Here below the reproducible example. I am trying to get the average of the 100 results coming from the "lst" function. I have tried lst$mean and mean(lst). It does not work. Any help would be highly appreciated.  ## R script for getting MedAe and MedAeSQ