[R] Simulation based on runif to get mean

smart hendsome putra_autumn86 at yahoo.com
Tue Jan 30 06:03:17 CET 2018


Hello everyone,
I have a question regarding simulating based on runif.  Let say I have generated matrix A and B based on runif. Then I find mean for each matrix A and matrix B.  I want this process to be done let say 10 times. Anyone can help me.  Actually I want make the function that I can play around with the number of simulation process that I want. Thanks.
Eg:
a <- matrix(runif(5,1, 10))

b <- matrix(runif(5,10, 20))

c <- cbind(a,b); c

mn <- apply(c,2,mean); mn

Regards,
Zuhri

	[[alternative HTML version deleted]]



More information about the R-help mailing list