search for: tp3456295p3456358

Displaying 1 result from an estimated 1 matches for "tp3456295p3456358".

2011 Apr 17
2
Repeating a function
Hello all, I currently have this function: drift <-function(p0=0.4,N=40,ngen=55){ p = p0 for( i in 1:ngen){ p = rbinom(1,2*N,p)/(2*N) } return( p ) } I want to repeat it 1000 times, then do some analysis on the results. I've tried using the rep() function, but that only gives me repeats of the first value of p. How can I get 1000 values of p for different iterations of the