# Definition of a population in its simplest form:
DL <- list(dl = c("A", "a"))
HL <- list(hl = c("B", "b"))
mutations <- list(
mutation(from = "A", to = "a", rate = 1e-3),
mutation(from = "B", to = "b", rate = 1e-3)
)
genomeObj <- setGenome(listHapLoci = HL, listDipLoci = DL)
pop <- setPopulation(
name = "A",
size = 1000,
dioecy = TRUE,
genomeObj = genomeObj,
selectionObj = setSelectNeutral(genomeObj),
mutMatrixObj = setMutationMatrix(genomeObj, mutations = mutations)
)
metapop <- setMetapopulation(populations = list(pop))
metapop <- simulate(metapop, nsim = 10, seed = 123)
# Other examples available in the documentation of the package
Run the code above in your browser using DataLab