[R] (no subject)

unknown yunusbb at inbox.ru
Fri Jun 24 14:42:28 CEST 2005


There is a function 'simMD()' in 'popgen' library which 
simulates a sample of genotype data as follows:
> library(popgen)
> x <- simMD(20, 2, 2, p = NULL, c(0.09, 0.05), ac = 2, beta = 1)
> x
  , , 1
 
      [,1] [,2]
 [1,]    1    1
 [2,]    1    1
      ... 
[37,]    1    2
[38,]    2    2
[39,]    2    2
[40,]    2    2
 
, , 2
 
      [,1] [,2]
 [1,]    2    2
 [2,]    1    2
 [3,]    1    2
      ...
[38,]    2    1
[39,]    1    2
[40,]    1    2
>
How can I repeat this function, for example, 1000 times to generate 1000 samples and assign each output to distinct 'vector' Xi, where i=1,2,...,1000
The goal is to generate a large number of samples using this function and then use them in further analysis.
Any suggestions would be appreciated
Sitdikov Mansor




More information about the R-help mailing list