Re: [R] r-help

From: Peter Dalgaard <p.dalgaard_at_biostat.ku.dk>
Date: Sun 26 Jun 2005 - 01:13:18 EST

"Sotdikov Mansor" <yunusbb@inbox.ru> writes:

> 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
...
> >
> 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

replicate(5, list(simMD(20, 2, 2, p = NULL, c(0.09, 0.05),

                       ac = 2, beta = 1)))

for larger values of 5 ;-)

The list() is there to prevent dimensions from getting lost.

-- 
   O__  ---- Peter Dalgaard             ุster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark          Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)                  FAX: (+45) 35327907

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Sun Jun 26 01:19:45 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:33:02 EST