aRetain(q0 = 0.05, sourceN = Inf, startN = 20, startAge = "juvenile",
startSR = 0.5, exactSR= FALSE, inisurv = 0.90, addN = 0, addyrs = c(0),
migrN = 0, migrfreq = 1, mpriority = FALSE, removeL = FALSE, K = 100,
Klag = 0, KAdults = FALSE, reprolag = 0, mature = 1, matingSys =
"monogamy", matingLength = "seasonal", meanMLRS = 1, sdMLRS = 0,
reproAgeM = c(1:200), AgeOnMLRS = "age/age", nMatings = 1,
retainBreeders = "male", MaxAge = 25, SenesAge = 10, adsurvivalF = 0.80,
adsurvivalM = 0.80, nonbrsurv = 0.80, nonbrsurvK = 0.80, juvsurv =
0.80, juvsurvK = 0.80, youngperF = 1.5, SDypF = 0.25, ypF1 = 1, ypF1yr
= 1, MAXypF = 2, MAXypFK = 2, ypFsex = "female", youngSR = 0.5,
trackall = TRUE, GeneCount = "adult", nyears = 50, nrepl = 100,
nreplprint = 10, printplots = FALSE)aRetain returns a list of sub-lists, with one sub-list for each replicate which contains two matrices: one that summarizes the population information for that replicate (one row for each year; columns = number of adults, number of breeding females, number of breeding males, number of copies of the rare allele, number of pairs, number of nonbreeders, number of founders remaining, number of migrants alive, mean age of breeding pairs), and one that gives pertinent information for all individuals in that replicate (one row for each individual; columns = ID, dam, sire, origin [1=starter, 2=supplemental, 3=local, 4=immigrant], birth year, number of years alive in the population, number of years bred, year added to population). The latter matrix includes all individuals if trackall = TRUE, or only those alive at the end of the simulation if trackall = FALSE. Run aRetain.summary, indiv.summary, and pedigree.summary to generate useful output from this information (averaged across replicates).aRetain.summary. An individual summary function (indiv.summary)
can output pertinent information (e.g. proportion bred, average number that
bred per generation) about individuals of each origin (founder, local, or
immigrant) in the population. A pedigree summary function
(pedigree.summary) can be used to describe accumulation of inbreeding
in the population by calling R package pedigree.
See the AlleleRetain Model Guide (available as a PDF file with this installation, or from the model's website at https://sites.google.com/site/alleleretain/) for more details and an example.## Simulate rare allele with frequency 0.05 in source population.
## 20 individuals are translocated to establish a new population with carrying
## capacity = 100 individuals. An additional 5 individuals are translocated
## once every 10 years as immigrants. Demographic parameter values are for a
## monogamous passerine bird species with a 5-yr average lifespan. Only 30
## iterations are run so the confidence intervals will be wide.
aR.temp <- aRetain(q0 = 0.05, sourceN = 2000, startN = 20, startAge =
"adult", startSR = 0.5, exactSR = FALSE, inisurv = 0.90, addN = 0, addyrs
= c(0), migrN = 5, migrfreq = 10, mpriority = FALSE, removeL = FALSE, K =
100, KAdults = FALSE, mature = 1, matingSys = "monogamy", matingLength =
"seasonal", retainBreeders = "male", MaxAge = 16, SenesAge = 5, adsurvivalF =
0.77, adsurvivalM = 0.77, nonbrsurv = 0.70, nonbrsurvK = 0.40, juvsurv = 0.60,
juvsurvK = 0.30, youngperF = 2.85, SDypF = 1.25, MAXypF = 6, MAXypFK = 6,
ypFsex = "female", youngSR = 0.5, trackall = TRUE, GeneCount = "all", nyears =
30, nrepl = 30, nreplprint = 10)
aRetain.summary(aR.temp, GeneCount = "all", alpha=0.05, dropextinct = TRUE)
indiv.summary(aR.temp, genlength=5, alpha=0.05)
pedigree.summary(aR.temp)Run the code above in your browser using DataLab