Displaying 1 result from an estimated 1 matches for "reproduciblefun".
2018 Jan 30
0
Simulation based on runif to get mean
...s <ruipbarradas at sapo.pt> Cc: Daniel Nordlund <djnordlund at gmail.com>, smart hendsome <putra_autumn86 at yahoo.com>, r-help at r-project.org Assunto: Re: [R] Simulation based on runif to get mean
Or a shorter version of Rui's approach:
set.seed(2511)? ? # Make the results reproduciblefun <- function(n){? f <- function(){? ? c(mean(runif(5,1,10)),mean(runif(5,10,20)))? }? replicate(n, f())}fun(10)
On Tue, Jan 30, 2018 at 12:03 PM, Rui Barradas <ruipbarradas at sapo.pt> wrote:
Hello,
Another way would be to use ?replicate and ?colMeans.
set.seed(2511)? ? # Make th...