newPop | R Documentation |
Creates an initial Pop-class
from an object of
MapPop-class
or NamedMapPop-class
.
The function is intended for use with output from functions such
as runMacs
, newMapPop
, or
quickHaplo
.
newPop(rawPop, simParam = NULL, ...)
rawPop |
an object of |
simParam |
an object of |
... |
additional arguments used internally |
Note that newPop
takes genomes from the
rawPop
and uses them without recombination! Hence, if you
call newPop(rawPop = founderGenomes)
twice, you will get
two sets of individuals with different id but the same genomes.
To get genetically different sets of individuals you can subset the
rawPop
input, say first half for one set and the second half
for the other set.
Returns an object of Pop-class
#Create founder haplotypes
founderPop = quickHaplo(nInd=2, nChr=1, segSites=10)
#Set simulation parameters
SP = SimParam$new(founderPop)
SP$addTraitA(10)
#Create population
pop = newPop(founderPop, simParam=SP)
isPop(pop)
#Misc
pop@misc$tmp1 = rnorm(n=2)
pop@misc$tmp2 = rnorm(n=2)
#MiscPop
pop@miscPop$tmp1 = sum(pop@misc$tmp1)
pop@miscPop$tmp2 = sum(pop@misc$tmp2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.