R : Copyright 2005, The R Foundation for Statistical Computing Version 2.1.1 (2005-06-20), ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for a HTML browser interface to help. Type 'q()' to quit R. > ### *
> ### > attach(NULL, name = "CheckExEnv") > assign(".CheckExEnv", as.environment(2), pos = length(search())) # base > ## add some hooks to label plot pages for base and grid graphics > setHook("plot.new", ".newplot.hook") > setHook("persp", ".newplot.hook") > setHook("grid.newpage", ".gridplot.hook") > > assign("cleanEx", + function(env = .GlobalEnv) { + rm(list = ls(envir = env, all.names = TRUE), envir = env) + RNGkind("default", "default") + set.seed(1) + options(warn = 1) + delayedAssign("T", stop("T used instead of TRUE"), + assign.env = .CheckExEnv) + delayedAssign("F", stop("F used instead of FALSE"), + assign.env = .CheckExEnv) + sch <- search() + newitems <- sch[! sch %in% .oldSearch] + for(item in rev(newitems)) + eval(substitute(detach(item), list(item=item))) + missitems <- .oldSearch[! .oldSearch %in% sch] + if(length(missitems)) + warning("items ", paste(missitems, collapse=", "), + " have been removed from the search path") + }, + env = .CheckExEnv) > assign("..nameEx", "__{must remake R-ex/*.R}__", env = .CheckExEnv) # for now > assign("ptime", proc.time(), env = .CheckExEnv) > grDevices::postscript("rmetasim-Examples.ps") > assign("par.postscript", graphics::par(no.readonly = TRUE), env = .CheckExEnv) > options(contrasts = c(unordered = "contr.treatment", ordered = "contr.poly")) > options(warn = 1) > library('rmetasim') Loading required package: ape Loading required package: gee Loading required package: nlme Loading required package: lattice > > assign(".oldSearch", search(), env = .CheckExEnv) > assign(".oldNS", loadedNamespaces(), env = .CheckExEnv) > cleanEx(); ..nameEx <- "FWright.landscape" > > ### * FWright.landscape > > flush(stderr()); flush(stdout()) > > ### Name: FWright.landscape > ### Title: Calculates Wright's Fixation index at each locus in each > ### population > ### Aliases: FWright.landscape > ### Keywords: misc > > ### ** Examples > > exampleland <- new.example.landscape() > FWright.landscape(exampleland) [,1] [,2] [,3] [1,] -0.071975498 NA -0.05896510 [2,] -0.002255074 NA -0.06485963 > exampleland <- simulate.landscape(exampleland, 4) > FWright.landscape(exampleland) [,1] [,2] [,3] [1,] 0.08499520 NA -0.02135375 [2,] 0.04339185 NA -0.02570694 > rm(exampleland) > > > > cleanEx(); ..nameEx <- "Fst.landscape" > > ### * Fst.landscape > > flush(stderr()); flush(stdout()) > > ### Name: Fst.landscape > ### Title: Calculates population structure statistic for the entire > ### landscape > ### Aliases: Fst.landscape > ### Keywords: misc > > ### ** Examples > > exampleland <- new.example.landscape() > exampleland <- simulate.landscape(exampleland, 4) > Fst <- Fst.landscape(exampleland,verb=TRUE) [1] "Populations: 2 Loci: 3" [1] "Mean per locus:" [1] 0.005989735 0.004793865 0.014612175 [1] "Overall mean: 0.00846525822452363" [1] "===" > Fst [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.005908112 4.779806e-05 7.338603e-03 0.003566380 0.01586208 0.003215434 [2,] 0.002740282 1.711622e-03 8.101039e-03 0.006622517 NaN NaN [3,] 0.016673756 1.026324e-02 2.692666e-05 0.037006953 0.02105753 NaN [,7] [,8] [,9] [1,] NaN NaN NaN [2,] NaN NaN NaN [3,] 0.009130733 0.006451613 0.01628664 > rm(exampleland,Fst) > > > > cleanEx(); ..nameEx <- "allelecount.landscape" > > ### * allelecount.landscape > > flush(stderr()); flush(stdout()) > > ### Name: allelecount.landscape > ### Title: Calculate allele numbers (frequency in the statistical sense) at > ### each locus in each population > ### Aliases: allelecount.landscape > ### Keywords: misc > > ### ** Examples > > exampleland <- new.example.landscape() > exampleland <- simulate.landscape(exampleland, 4) > allelefreq.landscape(exampleland,tbl.out=TRUE) , , loc = 1 alleles pop 0 1 2 3 4 6 1 0.217948718 0.217948718 0.320512821 0.076923077 0.160256410 0.006410256 2 0.157894737 0.223684211 0.243421053 0.111842105 0.263157895 0.000000000 alleles pop 5 7 9 1 0.000000000 0.000000000 0.000000000 2 0.000000000 0.000000000 0.000000000 , , loc = 2 alleles pop 0 1 2 3 4 6 1 0.230769231 0.141025641 0.628205128 0.000000000 0.000000000 0.000000000 2 0.276315789 0.171052632 0.539473684 0.013157895 0.000000000 0.000000000 alleles pop 5 7 9 1 0.000000000 0.000000000 0.000000000 2 0.000000000 0.000000000 0.000000000 , , loc = 3 alleles pop 0 1 2 3 4 6 1 0.089743590 0.070512821 0.121794872 0.243589744 0.173076923 0.000000000 2 0.177631579 0.131578947 0.118421053 0.098684211 0.296052632 0.000000000 alleles pop 5 7 9 1 0.256410256 0.012820513 0.032051282 2 0.177631579 0.000000000 0.000000000 > allelefreq.landscape(exampleland,tbl.out=FALSE) alleles Freq pop loc 1 0 0.217948718 1 1 2 1 0.217948718 1 1 3 2 0.320512821 1 1 4 3 0.076923077 1 1 5 4 0.160256410 1 1 6 6 0.006410256 1 1 7 0 0.157894737 2 1 8 1 0.223684211 2 1 9 2 0.243421053 2 1 10 3 0.111842105 2 1 11 4 0.263157895 2 1 12 0 0.230769231 1 2 13 1 0.141025641 1 2 14 2 0.628205128 1 2 15 0 0.276315789 2 2 16 1 0.171052632 2 2 17 2 0.539473684 2 2 18 3 0.013157895 2 2 19 0 0.089743590 1 3 20 1 0.070512821 1 3 21 2 0.121794872 1 3 22 3 0.243589744 1 3 23 4 0.173076923 1 3 24 5 0.256410256 1 3 25 7 0.012820513 1 3 26 9 0.032051282 1 3 27 0 0.177631579 2 3 28 1 0.131578947 2 3 29 2 0.118421053 2 3 30 3 0.098684211 2 3 31 4 0.296052632 2 3 32 5 0.177631579 2 3 > rm(exampleland) > > > > cleanEx(); ..nameEx <- "allelefreq.landscape" > > ### * allelefreq.landscape > > flush(stderr()); flush(stdout()) > > ### Name: allelefreq.landscape > ### Title: Calculate allele frequencies at each locus in each population > ### Aliases: allelefreq.landscape > ### Keywords: misc > > ### ** Examples > > exampleland <- new.example.landscape() > exampleland <- simulate.landscape(exampleland, 4) > allelefreq.landscape(exampleland,tbl.out=TRUE) , , loc = 1 alleles pop 0 1 2 3 4 6 1 0.217948718 0.217948718 0.320512821 0.076923077 0.160256410 0.006410256 2 0.157894737 0.223684211 0.243421053 0.111842105 0.263157895 0.000000000 alleles pop 5 7 9 1 0.000000000 0.000000000 0.000000000 2 0.000000000 0.000000000 0.000000000 , , loc = 2 alleles pop 0 1 2 3 4 6 1 0.230769231 0.141025641 0.628205128 0.000000000 0.000000000 0.000000000 2 0.276315789 0.171052632 0.539473684 0.013157895 0.000000000 0.000000000 alleles pop 5 7 9 1 0.000000000 0.000000000 0.000000000 2 0.000000000 0.000000000 0.000000000 , , loc = 3 alleles pop 0 1 2 3 4 6 1 0.089743590 0.070512821 0.121794872 0.243589744 0.173076923 0.000000000 2 0.177631579 0.131578947 0.118421053 0.098684211 0.296052632 0.000000000 alleles pop 5 7 9 1 0.256410256 0.012820513 0.032051282 2 0.177631579 0.000000000 0.000000000 > allelefreq.landscape(exampleland,tbl.out=FALSE) alleles Freq pop loc 1 0 0.217948718 1 1 2 1 0.217948718 1 1 3 2 0.320512821 1 1 4 3 0.076923077 1 1 5 4 0.160256410 1 1 6 6 0.006410256 1 1 7 0 0.157894737 2 1 8 1 0.223684211 2 1 9 2 0.243421053 2 1 10 3 0.111842105 2 1 11 4 0.263157895 2 1 12 0 0.230769231 1 2 13 1 0.141025641 1 2 14 2 0.628205128 1 2 15 0 0.276315789 2 2 16 1 0.171052632 2 2 17 2 0.539473684 2 2 18 3 0.013157895 2 2 19 0 0.089743590 1 3 20 1 0.070512821 1 3 21 2 0.121794872 1 3 22 3 0.243589744 1 3 23 4 0.173076923 1 3 24 5 0.256410256 1 3 25 7 0.012820513 1 3 26 9 0.032051282 1 3 27 0 0.177631579 2 3 28 1 0.131578947 2 3 29 2 0.118421053 2 3 30 3 0.098684211 2 3 31 4 0.296052632 2 3 32 5 0.177631579 2 3 > rm(exampleland) > > > > cleanEx(); ..nameEx <- "atomic.simulation" > > ### * atomic.simulation > > flush(stderr()); flush(stdout()) > > ### Name: Components of Simulations > ### Title: Code components to simulate a landscape > ### Aliases: advance.landscape carry.landscape extinct.landscape > ### reproduce.landscape survive.landscape > ### Keywords: misc > > ### ** Examples > > exampleland <- new.example.landscape() > exampleland <- simulate.landscape(exampleland, 4) > exampleland $intparam $intparam$habitats [1] 2 $intparam$stages [1] 2 $intparam$locusnum [1] 3 $intparam$numepochs [1] 1 $intparam$currentgen [1] 4 $intparam$currentepoch [1] 0 $intparam$totalgens [1] 1000 $intparam$numdemos [1] 1 $intparam$maxlandsize [1] 2e+05 $switchparam $switchparam$randepoch [1] 0 $switchparam$randdemo [1] 0 $switchparam$multp [1] 0 $floatparam $floatparam$selfing [1] 0 $demography $demography$localdem $demography$localdem[[1]] $demography$localdem[[1]]$LocalS [,1] [,2] [1,] 0 0 [2,] 1 0 $demography$localdem[[1]]$LocalR [,1] [,2] [1,] 0 1.1 [2,] 0 0.0 $demography$localdem[[1]]$LocalM [,1] [,2] [1,] 0 0 [2,] 0 1 $demography$epochs $demography$epochs[[1]] $demography$epochs[[1]]$RndChooseProb [1] 1 $demography$epochs[[1]]$StartGen [1] 0 $demography$epochs[[1]]$Extinct [1] 0 0 $demography$epochs[[1]]$Carry [1] 1000 1000 $demography$epochs[[1]]$Localprob [1] 1 $demography$epochs[[1]]$S [,1] [,2] [,3] [,4] [1,] 0 0 0 0 [2,] 1 0 0 0 [3,] 0 0 0 0 [4,] 0 0 1 0 $demography$epochs[[1]]$R [,1] [,2] [,3] [,4] [1,] 0 1.1 0 0.0 [2,] 0 0.0 0 0.0 [3,] 0 0.0 0 1.1 [4,] 0 0.0 0 0.0 $demography$epochs[[1]]$M [,1] [,2] [,3] [,4] [1,] 0 0 0 0 [2,] 0 1 0 0 [3,] 0 0 0 0 [4,] 0 0 0 1 $loci $loci[[1]] $loci[[1]]$type [1] 251 $loci[[1]]$ploidy [1] 2 $loci[[1]]$trans [1] 0 $loci[[1]]$rate [1] 0.001 $loci[[1]]$alleles $loci[[1]]$alleles[[1]] $loci[[1]]$alleles[[1]]$aindex [1] 0 $loci[[1]]$alleles[[1]]$birth [1] 0 $loci[[1]]$alleles[[1]]$prop [1] 0.21 $loci[[1]]$alleles[[1]]$state [1] 1 $loci[[1]]$alleles[[2]] $loci[[1]]$alleles[[2]]$aindex [1] 1 $loci[[1]]$alleles[[2]]$birth [1] 0 $loci[[1]]$alleles[[2]]$prop [1] 0.21 $loci[[1]]$alleles[[2]]$state [1] 2 $loci[[1]]$alleles[[3]] $loci[[1]]$alleles[[3]]$aindex [1] 2 $loci[[1]]$alleles[[3]]$birth [1] 0 $loci[[1]]$alleles[[3]]$prop [1] 0.195 $loci[[1]]$alleles[[3]]$state [1] 3 $loci[[1]]$alleles[[4]] $loci[[1]]$alleles[[4]]$aindex [1] 3 $loci[[1]]$alleles[[4]]$birth [1] 0 $loci[[1]]$alleles[[4]]$prop [1] 0.145 $loci[[1]]$alleles[[4]]$state [1] 4 $loci[[1]]$alleles[[5]] $loci[[1]]$alleles[[5]]$aindex [1] 4 $loci[[1]]$alleles[[5]]$birth [1] 0 $loci[[1]]$alleles[[5]]$prop [1] 0.24 $loci[[1]]$alleles[[5]]$state [1] 5 $loci[[1]]$alleles[[6]] $loci[[1]]$alleles[[6]]$aindex [1] 6 $loci[[1]]$alleles[[6]]$birth [1] 3 $loci[[1]]$alleles[[6]]$prop [1] 0.003048780 $loci[[1]]$alleles[[6]]$state [1] 8 $loci[[2]] $loci[[2]]$type [1] 252 $loci[[2]]$ploidy [1] 1 $loci[[2]]$trans [1] 1 $loci[[2]]$rate [1] 0.005 $loci[[2]]$alleles $loci[[2]]$alleles[[1]] $loci[[2]]$alleles[[1]]$aindex [1] 0 $loci[[2]]$alleles[[1]]$birth [1] 0 $loci[[2]]$alleles[[1]]$prop [1] 0.21 $loci[[2]]$alleles[[1]]$state [1] 1 $loci[[2]]$alleles[[2]] $loci[[2]]$alleles[[2]]$aindex [1] 1 $loci[[2]]$alleles[[2]]$birth [1] 0 $loci[[2]]$alleles[[2]]$prop [1] 0.2 $loci[[2]]$alleles[[2]]$state [1] 2 $loci[[2]]$alleles[[3]] $loci[[2]]$alleles[[3]]$aindex [1] 2 $loci[[2]]$alleles[[3]]$birth [1] 0 $loci[[2]]$alleles[[3]]$prop [1] 0.59 $loci[[2]]$alleles[[3]]$state [1] 3 $loci[[2]]$alleles[[4]] $loci[[2]]$alleles[[4]]$aindex [1] 3 $loci[[2]]$alleles[[4]]$birth [1] 3 $loci[[2]]$alleles[[4]]$prop [1] 0.003484321 $loci[[2]]$alleles[[4]]$state [1] 4 $loci[[3]] $loci[[3]]$type [1] 253 $loci[[3]]$ploidy [1] 2 $loci[[3]]$trans [1] 0 $loci[[3]]$rate [1] 0.007 $loci[[3]]$alleles $loci[[3]]$alleles[[1]] $loci[[3]]$alleles[[1]]$aindex [1] 0 $loci[[3]]$alleles[[1]]$birth [1] 0 $loci[[3]]$alleles[[1]]$prop [1] 0.18 $loci[[3]]$alleles[[1]]$state [1] "TTGCACCGGAAAGTCTGCTCCAGATTATCTTGTACGCAGTCGCGGCATGGTCTAAATGGTCTTTGTTCACTCTTT" $loci[[3]]$alleles[[2]] $loci[[3]]$alleles[[2]]$aindex [1] 1 $loci[[3]]$alleles[[2]]$birth [1] 0 $loci[[3]]$alleles[[2]]$prop [1] 0.155 $loci[[3]]$alleles[[2]]$state [1] "CCTCCTGTTCAGAAAAAGCCCTTCGGTTCGAATCGCGTTAAGATGCTTACTGAAGGAAGCGGGCGGGATGTAGAC" $loci[[3]]$alleles[[3]] $loci[[3]]$alleles[[3]]$aindex [1] 2 $loci[[3]]$alleles[[3]]$birth [1] 0 $loci[[3]]$alleles[[3]]$prop [1] 0.185 $loci[[3]]$alleles[[3]]$state [1] "GGTTGAGATATCTCCTATGTGCCTTCGGGCTACGCACGCGGTACTGACTCTAGTAGGATGCACCCTGCCTTATGC" $loci[[3]]$alleles[[4]] $loci[[3]]$alleles[[4]]$aindex [1] 3 $loci[[3]]$alleles[[4]]$birth [1] 0 $loci[[3]]$alleles[[4]]$prop [1] 0.135 $loci[[3]]$alleles[[4]]$state [1] "GTATCTATGTGGGTTTGCATATATCCCTGTAATTCGTTCGAACGAAATATATATCAGCTAATAAAAACTGGAAAC" $loci[[3]]$alleles[[5]] $loci[[3]]$alleles[[5]]$aindex [1] 4 $loci[[3]]$alleles[[5]]$birth [1] 0 $loci[[3]]$alleles[[5]]$prop [1] 0.195 $loci[[3]]$alleles[[5]]$state [1] "GATTTCACATAACGTTATCGGTTCCCCCTCCTTCATTAGCCAGTGTTATGTACTCTCACTATCTGCAGGTTGCAA" $loci[[3]]$alleles[[6]] $loci[[3]]$alleles[[6]]$aindex [1] 5 $loci[[3]]$alleles[[6]]$birth [1] 0 $loci[[3]]$alleles[[6]]$prop [1] 0.15 $loci[[3]]$alleles[[6]]$state [1] "TTCATTGGCAACCACAACGATGTTAGACCCGTCACCTGCGTTTGCTGGATTACCCCATGACGATCATGGTTTCAA" $loci[[3]]$alleles[[7]] $loci[[3]]$alleles[[7]]$aindex [1] 7 $loci[[3]]$alleles[[7]]$birth [1] 2 $loci[[3]]$alleles[[7]]$prop [1] 0.003921569 $loci[[3]]$alleles[[7]]$state [1] "GATTTCACATAACGTTATCGGTTCCCCCTCCTTCATTAGACAGTGTTATGTACTCTCACTATCTGCAGGTTGCAA" $loci[[3]]$alleles[[8]] $loci[[3]]$alleles[[8]]$aindex [1] 9 $loci[[3]]$alleles[[8]]$birth [1] 2 $loci[[3]]$alleles[[8]]$prop [1] 0.002849003 $loci[[3]]$alleles[[8]]$state [1] "GATTTCACATAACGTTATCGGTTCCCCCTCCTTCATTAGCCAGTGTTATGTACTCTCAATATCTGCAGGTTGCAA" $individuals [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1 0 3 2 2 2 3 5 [2,] 1 0 3 0 1 2 3 4 [3,] 1 0 3 2 4 2 0 2 [4,] 1 0 3 0 4 2 1 3 [5,] 1 0 3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 0 4 [152,] 3 0 3 2 2 2 0 2 [153,] 3 0 3 2 2 2 0 1 [154,] 3 0 3 1 4 2 2 4 > rm(exampleland) > > > > cleanEx(); ..nameEx <- "clean.landscape" > > ### * clean.landscape > > flush(stderr()); flush(stdout()) > > ### Name: clean.landscape > ### Title: Function to resolve inconsistencies within a landscape > ### Aliases: clean.landscape > ### Keywords: misc > > ### ** Examples > > exampleland <- new.example.landscape() > exampleland <- simulate.landscape(exampleland, 4) > exampleland.clean <- clean.landscape(exampleland) > rm(exampleland) > > > > cleanEx(); ..nameEx <- "compress.landscape" > > ### * compress.landscape > > flush(stderr()); flush(stdout()) > > ### Name: compress.landscape > ### Title: Function to resolve inconsistencies within a landscape, > ### deprecated > ### Aliases: compress.landscape > ### Keywords: misc > > ### ** Examples > > exampleland <- new.example.landscape() > exampleland <- simulate.landscape(exampleland, 4) > exampleland.clean <- compress.landscape(exampleland) > rm(exampleland) > > > > cleanEx(); ..nameEx <- "exp.het.landscape" > > ### * exp.het.landscape > > flush(stderr()); flush(stdout()) > > ### Name: exp.het.landscape > ### Title: Calculate expected heterozygosity > ### Aliases: exp.het.landscape > ### Keywords: misc > > ### ** Examples > > exampleland <- new.example.landscape() > exampleland <- simulate.landscape(exampleland, 4) > exphet <- exp.het.landscape(exampleland) > rm(exampleland) > > > > cleanEx(); ..nameEx <- "is.landscape" > > ### * is.landscape > > flush(stderr()); flush(stdout()) > > ### Name: is.landscape > ### Title: Test whether an object is a (fairly) legitimate landscape > ### Aliases: is.landscape > ### Keywords: misc > > ### ** Examples > > exampleland <- new.example.landscape() > is.landscape(exampleland) [1] TRUE > rm(exampleland) > > > > cleanEx(); ..nameEx <- "landscape.locus" > > ### * landscape.locus > > flush(stderr()); flush(stdout()) > > ### Name: landscape.locus > ### Title: return a matrix containing genotypes for a particular locus > ### Aliases: landscape.locus > ### Keywords: misc > > ### ** Examples > > exampleland <- new.example.landscape() > exampleland <- simulate.landscape(exampleland, 4) > print("Allele frequencies at locus 1") [1] "Allele frequencies at locus 1" > table(landscape.locus(1,exampleland)[,c(-1,-2,-3)]) 0 1 2 3 4 6 58 68 87 29 65 1 > rm(exampleland) > > > > cleanEx(); ..nameEx <- "landscape.states" > > ### * landscape.states > > flush(stderr()); flush(stdout()) > > ### Name: landscape.states > ### Title: return a matrix containing actual genotypes for a particular > ### locus > ### Aliases: landscape.states states > ### Keywords: misc > > ### ** Examples > > exampleland <- new.example.landscape() > exampleland <- simulate.landscape(exampleland, 4) > print("Allele frequencies at locus 1") [1] "Allele frequencies at locus 1" > table(landscape.locus(1,exampleland)[,c(-1,-2,-3)]) 0 1 2 3 4 6 58 68 87 29 65 1 > rm(exampleland) > > > > cleanEx(); ..nameEx <- "locusutils" > > ### * locusutils > > flush(stderr()); flush(stdout()) > > ### Name: Genetic locus utilities > ### Title: Provides convenient summarys of locus characteristics > ### Aliases: locusvec ploidy > ### Keywords: misc > > ### ** Examples > > exampleland <- new.example.landscape() > exampleland <- simulate.landscape(exampleland, 4) > locusvec(exampleland) [1] 1 1 2 3 3 > ploidy(exampleland) [1] 2 1 2 > > > > cleanEx(); ..nameEx <- "new.epoch" > > ### * new.epoch > > flush(stderr()); flush(stdout()) > > ### Name: new.epoch > ### Title: Create an Epoch > ### Aliases: new.epoch > ### Keywords: misc > > ### ** Examples > > > exampleS <- matrix(c(0.1, 0, 0.5, 0.3), nrow = 2) > exampleR <- matrix(c(0, 1.1, 0, 0), nrow = 2) > exampleM <- matrix(c(0, 0, 0, 1), nrow = 2) > > exampleland <- new.landscape.empty() > exampleland <- new.intparam.land(exampleland, s=2, h=2) > exampleland <- new.floatparam.land(exampleland) > exampleland <- new.switchparam.land(exampleland) > exampleland <- new.local.demo(exampleland,exampleS,exampleR,exampleM) > > ## nonsense matricies > exampleS <- matrix(c(rep(0,4), + rep(1,4), + rep(0,4), + rep(1,4)), nrow = 4) > exampleR <- matrix(c(rep(0.5,4), + rep(0,4), + rep(0.5,4), + rep(0,4)), nrow = 4) > exampleM <- matrix(c(rep(0,4), + rep(.25,4), + rep(0,4), + rep(0,4)), nrow = 4) > > ## defaults > exampleland<- new.epoch(exampleland,exampleS,exampleR,exampleM) > > exampleland$demography$epochs[[1]] $RndChooseProb [1] 1 $StartGen [1] 0 $Extinct [1] 0 0 $Carry [1] 1000 1000 $Localprob [1] 1 $S [,1] [,2] [,3] [,4] [1,] 0 1 0 1 [2,] 0 1 0 1 [3,] 0 1 0 1 [4,] 0 1 0 1 $R [,1] [,2] [,3] [,4] [1,] 0.5 0 0.5 0 [2,] 0.5 0 0.5 0 [3,] 0.5 0 0.5 0 [4,] 0.5 0 0.5 0 $M [,1] [,2] [,3] [,4] [1,] 0 0.25 0 0 [2,] 0 0.25 0 0 [3,] 0 0.25 0 0 [4,] 0 0.25 0 0 > > rm(exampleS) > rm(exampleR) > rm(exampleM) > rm(exampleland) > > > > cleanEx(); ..nameEx <- "new.epoch.island" > > ### * new.epoch.island > > flush(stderr()); flush(stdout()) > > ### Name: new.epoch.island > ### Title: Create an Island Model Epoch > ### Aliases: new.epoch.island > ### Keywords: misc > > ### ** Examples > > > exampleS <- matrix(c(0.1, 0, 0.5, 0.3), nrow = 2) > exampleR <- matrix(c(0, 1.1, 0, 0), nrow = 2) > exampleM <- matrix(c(0, 0, 0, 1), nrow = 2) > > exampleland <- new.landscape.empty() > exampleland <- new.intparam.land(exampleland, s=2, h=2) > exampleland <- new.floatparam.land(exampleland) > exampleland <- new.switchparam.land(exampleland) > exampleland <- new.local.demo(exampleland,exampleS,exampleR,exampleM) > > exampleland <- new.epoch.island(exampleland,.1,c(0,1),c(0,1),.3,c(0,1),c(1,0),.5,c(1,0),c(0,1)) > > exampleland$demography$epochs[[1]] $RndChooseProb [1] 1 $StartGen [1] 0 $Extinct [1] 0 0 $Carry [1] 1000 1000 $Localprob [1] 1 $S [,1] [,2] [,3] [,4] [1,] 0 0.0 0 0.0 [2,] 0 0.1 0 0.1 [3,] 0 0.0 0 0.0 [4,] 0 0.1 0 0.1 $R [,1] [,2] [,3] [,4] [1,] 0 0.3 0 0.3 [2,] 0 0.0 0 0.0 [3,] 0 0.3 0 0.3 [4,] 0 0.0 0 0.0 $M [,1] [,2] [,3] [,4] [1,] 0.0 0 0.0 0 [2,] 0.5 0 0.5 0 [3,] 0.0 0 0.0 0 [4,] 0.5 0 0.5 0 > > rm(exampleland) > > > > cleanEx(); ..nameEx <- "new.example.landscape" > > ### * new.example.landscape > > flush(stderr()); flush(stdout()) > > ### Name: new.example.landscape > ### Title: Create a Default Landscape > ### Aliases: new.example.landscape > ### Keywords: misc > > ### ** Examples > > ## Only usage > new.example.landscape() $intparam $intparam$habitats [1] 2 $intparam$stages [1] 2 $intparam$locusnum [1] 3 $intparam$numepochs [1] 1 $intparam$currentgen [1] 0 $intparam$currentepoch [1] 0 $intparam$totalgens [1] 1000 $intparam$numdemos [1] 1 $intparam$maxlandsize [1] 2e+05 $switchparam $switchparam$randepoch [1] 0 $switchparam$randdemo [1] 0 $switchparam$multp [1] 0 $floatparam $floatparam$selfing [1] 0 $demography $demography$localdem $demography$localdem[[1]] $demography$localdem[[1]]$LocalS [,1] [,2] [1,] 0 0 [2,] 1 0 $demography$localdem[[1]]$LocalR [,1] [,2] [1,] 0 1.1 [2,] 0 0.0 $demography$localdem[[1]]$LocalM [,1] [,2] [1,] 0 0 [2,] 0 1 $demography$epochs $demography$epochs[[1]] $demography$epochs[[1]]$RndChooseProb [1] 1 $demography$epochs[[1]]$StartGen [1] 0 $demography$epochs[[1]]$Extinct [1] 0 0 $demography$epochs[[1]]$Carry [1] 1000 1000 $demography$epochs[[1]]$Localprob [1] 1 $demography$epochs[[1]]$S [,1] [,2] [,3] [,4] [1,] 0 0 0 0 [2,] 0 0 0 0 [3,] 0 0 0 0 [4,] 0 0 0 0 $demography$epochs[[1]]$R [,1] [,2] [,3] [,4] [1,] 0 0 0 0 [2,] 0 0 0 0 [3,] 0 0 0 0 [4,] 0 0 0 0 $demography$epochs[[1]]$M [,1] [,2] [,3] [,4] [1,] 0 0 0 0 [2,] 0 0 0 0 [3,] 0 0 0 0 [4,] 0 0 0 0 $loci $loci[[1]] $loci[[1]]$type [1] 251 $loci[[1]]$ploidy [1] 2 $loci[[1]]$trans [1] 0 $loci[[1]]$rate [1] 0.001 $loci[[1]]$alleles $loci[[1]]$alleles[[1]] $loci[[1]]$alleles[[1]]$aindex [1] 0 $loci[[1]]$alleles[[1]]$birth [1] 0 $loci[[1]]$alleles[[1]]$prop [1] 0.2 $loci[[1]]$alleles[[1]]$state [1] 1 $loci[[1]]$alleles[[2]] $loci[[1]]$alleles[[2]]$aindex [1] 1 $loci[[1]]$alleles[[2]]$birth [1] 0 $loci[[1]]$alleles[[2]]$prop [1] 0.2 $loci[[1]]$alleles[[2]]$state [1] 2 $loci[[1]]$alleles[[3]] $loci[[1]]$alleles[[3]]$aindex [1] 2 $loci[[1]]$alleles[[3]]$birth [1] 0 $loci[[1]]$alleles[[3]]$prop [1] 0.2 $loci[[1]]$alleles[[3]]$state [1] 3 $loci[[1]]$alleles[[4]] $loci[[1]]$alleles[[4]]$aindex [1] 3 $loci[[1]]$alleles[[4]]$birth [1] 0 $loci[[1]]$alleles[[4]]$prop [1] 0.2 $loci[[1]]$alleles[[4]]$state [1] 4 $loci[[1]]$alleles[[5]] $loci[[1]]$alleles[[5]]$aindex [1] 4 $loci[[1]]$alleles[[5]]$birth [1] 0 $loci[[1]]$alleles[[5]]$prop [1] 0.2 $loci[[1]]$alleles[[5]]$state [1] 5 $loci[[2]] $loci[[2]]$type [1] 252 $loci[[2]]$ploidy [1] 1 $loci[[2]]$trans [1] 1 $loci[[2]]$rate [1] 0.005 $loci[[2]]$alleles $loci[[2]]$alleles[[1]] $loci[[2]]$alleles[[1]]$aindex [1] 0 $loci[[2]]$alleles[[1]]$birth [1] 0 $loci[[2]]$alleles[[1]]$prop [1] 0.2 $loci[[2]]$alleles[[1]]$state [1] 1 $loci[[2]]$alleles[[2]] $loci[[2]]$alleles[[2]]$aindex [1] 1 $loci[[2]]$alleles[[2]]$birth [1] 0 $loci[[2]]$alleles[[2]]$prop [1] 0.2 $loci[[2]]$alleles[[2]]$state [1] 2 $loci[[2]]$alleles[[3]] $loci[[2]]$alleles[[3]]$aindex [1] 2 $loci[[2]]$alleles[[3]]$birth [1] 0 $loci[[2]]$alleles[[3]]$prop [1] 0.6 $loci[[2]]$alleles[[3]]$state [1] 3 $loci[[3]] $loci[[3]]$type [1] 253 $loci[[3]]$ploidy [1] 2 $loci[[3]]$trans [1] 0 $loci[[3]]$rate [1] 0.007 $loci[[3]]$alleles $loci[[3]]$alleles[[1]] $loci[[3]]$alleles[[1]]$aindex [1] 0 $loci[[3]]$alleles[[1]]$birth [1] 0 $loci[[3]]$alleles[[1]]$prop [1] 0.1666667 $loci[[3]]$alleles[[1]]$state [1] "TTGCACCGGAAAGTCTGCTCCAGATTATCTTGTACGCAGTCGCGGCATGGTCTAAATGGTCTTTGTTCACTCTTT" $loci[[3]]$alleles[[2]] $loci[[3]]$alleles[[2]]$aindex [1] 1 $loci[[3]]$alleles[[2]]$birth [1] 0 $loci[[3]]$alleles[[2]]$prop [1] 0.1666667 $loci[[3]]$alleles[[2]]$state [1] "CCTCCTGTTCAGAAAAAGCCCTTCGGTTCGAATCGCGTTAAGATGCTTACTGAAGGAAGCGGGCGGGATGTAGAC" $loci[[3]]$alleles[[3]] $loci[[3]]$alleles[[3]]$aindex [1] 2 $loci[[3]]$alleles[[3]]$birth [1] 0 $loci[[3]]$alleles[[3]]$prop [1] 0.1666667 $loci[[3]]$alleles[[3]]$state [1] "GGTTGAGATATCTCCTATGTGCCTTCGGGCTACGCACGCGGTACTGACTCTAGTAGGATGCACCCTGCCTTATGC" $loci[[3]]$alleles[[4]] $loci[[3]]$alleles[[4]]$aindex [1] 3 $loci[[3]]$alleles[[4]]$birth [1] 0 $loci[[3]]$alleles[[4]]$prop [1] 0.1666667 $loci[[3]]$alleles[[4]]$state [1] "GTATCTATGTGGGTTTGCATATATCCCTGTAATTCGTTCGAACGAAATATATATCAGCTAATAAAAACTGGAAAC" $loci[[3]]$alleles[[5]] $loci[[3]]$alleles[[5]]$aindex [1] 4 $loci[[3]]$alleles[[5]]$birth [1] 0 $loci[[3]]$alleles[[5]]$prop [1] 0.1666667 $loci[[3]]$alleles[[5]]$state [1] "GATTTCACATAACGTTATCGGTTCCCCCTCCTTCATTAGCCAGTGTTATGTACTCTCACTATCTGCAGGTTGCAA" $loci[[3]]$alleles[[6]] $loci[[3]]$alleles[[6]]$aindex [1] 5 $loci[[3]]$alleles[[6]]$birth [1] 0 $loci[[3]]$alleles[[6]]$prop [1] 0.1666667 $loci[[3]]$alleles[[6]]$state [1] "TTCATTGGCAACCACAACGATGTTAGACCCGTCACCTGCGTTTGCTGGATTACCCCATGACGATCATGGTTTCAA" $individuals [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 0 0 0 0 4 2 0 5 [2,] 0 0 0 2 3 1 4 3 [3,] 0 0 0 1 0 2 2 2 [4,] 0 0 0 4 2 2 4 1 [5,] 0 0 0 2 2 2 4 4 [6,] 0 0 0 0 1 0 5 4 [7,] 0 0 0 1 4 0 3 2 [8,] 0 0 0 4 0 0 3 0 [9,] 0 0 0 4 0 2 2 3 [10,] 0 0 0 2 4 2 0 3 [11,] 0 0 0 1 4 1 0 2 [12,] 0 0 0 0 2 1 3 5 [13,] 0 0 0 0 4 2 2 0 [14,] 0 0 0 2 4 2 0 1 [15,] 0 0 0 1 2 1 1 5 [16,] 0 0 0 1 0 1 4 3 [17,] 0 0 0 1 4 2 2 5 [18,] 0 0 0 2 2 2 3 1 [19,] 0 0 0 0 4 2 0 4 [20,] 0 0 0 4 1 2 0 2 [21,] 0 0 0 4 2 2 2 4 [22,] 0 0 0 4 0 2 1 5 [23,] 0 0 0 1 1 1 4 0 [24,] 0 0 0 2 1 2 3 0 [25,] 0 0 0 3 4 2 1 4 [26,] 0 0 0 0 1 1 4 5 [27,] 0 0 0 0 2 0 4 1 [28,] 0 0 0 4 2 0 4 0 [29,] 0 0 0 1 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 0 1 1 1 0 3 [79,] 2 0 0 4 4 0 2 5 [80,] 2 0 0 0 2 1 0 2 [81,] 2 0 0 0 2 1 4 2 [82,] 2 0 0 3 1 0 3 4 [83,] 2 0 0 4 2 2 2 0 [84,] 2 0 0 4 2 2 0 0 [85,] 2 0 0 3 2 2 0 1 [86,] 2 0 0 1 0 1 5 3 [87,] 2 0 0 0 3 2 0 4 [88,] 2 0 0 4 3 1 0 4 [89,] 2 0 0 0 0 2 2 2 [90,] 2 0 0 2 0 0 1 1 [91,] 2 0 0 2 4 2 3 4 [92,] 2 0 0 4 3 2 2 1 [93,] 2 0 0 0 3 1 0 4 [94,] 2 0 0 4 0 0 5 0 [95,] 2 0 0 3 2 2 2 5 [96,] 2 0 0 3 1 2 1 5 [97,] 2 0 0 4 0 2 2 4 [98,] 2 0 0 4 3 2 2 4 [99,] 2 0 0 3 0 2 1 4 [100,] 2 0 0 1 2 1 4 2 > > > cleanEx(); ..nameEx <- "new.floatparam.land" > > ### * new.floatparam.land > > flush(stderr()); flush(stdout()) > > ### Name: new.floatparam.land > ### Title: Create a set of floating point parameters > ### Aliases: new.floatparam.land > ### Keywords: misc > > ### ** Examples > > ## Defaults > exampleland <- new.landscape.empty() > exampleland <- new.floatparam.land(exampleland) > exampleland$floatparam $selfing [1] 0 > > ## .5 selfing rate > exampleland <- new.landscape.empty() > exampleland <- new.floatparam.land(exampleland,s=0.5) > exampleland$floatparam $selfing [1] 0.5 > > rm(exampleland) > > > > cleanEx(); ..nameEx <- "new.individuals" > > ### * new.individuals > > flush(stderr()); flush(stdout()) > > ### Name: new.individuals > ### Title: Fill a landscape with individuals > ### Aliases: new.individuals > ### Keywords: misc > > ### ** Examples > > > exampleS <- matrix(c(0.1, 0, 0.5, 0.3), nrow = 2) > exampleR <- matrix(c(0, 1.1, 0, 0), nrow = 2) > exampleM <- matrix(c(0, 0, 0, 1), nrow = 2) > > exampleland <- new.landscape.empty() > exampleland <- new.intparam.land(exampleland, s=2, h=2) > exampleland <- new.floatparam.land(exampleland) > exampleland <- new.switchparam.land(exampleland) > exampleland <- new.local.demo(exampleland,exampleS,exampleR,exampleM) > > ## nonsense matricies > exampleS <- matrix(c(rep(0,4), + rep(1,4), + rep(0,4), + rep(1,4)), nrow = 4) > exampleR <- matrix(c(rep(0.5,4), + rep(0,4), + rep(0.5,4), + rep(0,4)), nrow = 4) > exampleM <- matrix(c(rep(0,4), + rep(.25,4), + rep(0,4), + rep(0,4)), nrow = 4) > > exampleland<- new.epoch(exampleland,exampleS,exampleR,exampleM) > exampleland <- new.locus(exampleland,type=2,ploidy=2,mutationrate=.001,numalleles=5,allelesize=100) > exampleland <- new.locus(exampleland,type=1,ploidy=1,mutationrate=.001,numalleles=3) > exampleland <- new.locus(exampleland,type=0,ploidy=2,mutationrate=.004,numalleles=4) > > exampleland <- new.individuals(exampleland, + c(5,20,7,15)) > > exampleland$individuals [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 0 0 0 3 1 1 0 1 [2,] 0 0 0 2 3 1 0 3 [3,] 0 0 0 1 0 0 0 0 [4,] 0 0 0 4 4 1 1 3 [5,] 0 0 0 1 2 0 2 0 [6,] 1 0 0 3 0 2 1 0 [7,] 1 0 0 4 0 2 2 1 [8,] 1 0 0 1 2 2 3 1 [9,] 1 0 0 3 1 2 3 0 [10,] 1 0 0 0 2 0 2 1 [11,] 1 0 0 3 3 1 3 3 [12,] 1 0 0 2 0 2 0 3 [13,] 1 0 0 2 0 1 1 2 [14,] 1 0 0 1 1 2 3 1 [15,] 1 0 0 0 1 1 2 2 [16,] 1 0 0 2 4 2 1 0 [17,] 1 0 0 3 3 1 0 2 [18,] 1 0 0 2 1 0 0 3 [19,] 1 0 0 2 4 0 3 2 [20,] 1 0 0 2 2 1 2 1 [21,] 1 0 0 4 0 2 2 3 [22,] 1 0 0 1 3 2 3 1 [23,] 1 0 0 1 1 2 2 0 [24,] 1 0 0 2 1 2 1 1 [25,] 1 0 0 0 3 1 3 2 [26,] 2 0 0 4 1 1 1 2 [27,] 2 0 0 1 4 1 2 0 [28,] 2 0 0 3 1 0 3 1 [29,] 2 0 0 1 0 0 3 0 [30,] 2 0 0 0 1 2 3 2 [31,] 2 0 0 1 2 2 1 3 [32,] 2 0 0 4 3 2 0 0 [33,] 3 0 0 4 2 1 0 0 [34,] 3 0 0 1 0 0 3 3 [35,] 3 0 0 4 2 0 3 3 [36,] 3 0 0 3 4 1 1 1 [37,] 3 0 0 0 1 0 2 2 [38,] 3 0 0 2 1 1 2 3 [39,] 3 0 0 2 0 0 2 0 [40,] 3 0 0 2 4 2 3 1 [41,] 3 0 0 0 1 2 0 3 [42,] 3 0 0 2 2 2 3 0 [43,] 3 0 0 3 2 2 2 2 [44,] 3 0 0 3 0 1 2 1 [45,] 3 0 0 0 4 0 1 1 [46,] 3 0 0 3 3 2 2 3 [47,] 3 0 0 4 3 1 1 0 > > rm(exampleS) > rm(exampleR) > rm(exampleM) > rm(exampleland) > > > > cleanEx(); ..nameEx <- "new.intparam.land" > > ### * new.intparam.land > > flush(stderr()); flush(stdout()) > > ### Name: new.intparam.land > ### Title: Create a set of integer parameters > ### Aliases: new.intparam.land > ### Keywords: misc > > ### ** Examples > > ## Defaults > exampleland <- new.landscape.empty() > exampleland <- new.intparam.land(exampleland) > exampleland$intparam $habitats [1] 1 $stages [1] 1 $locusnum [1] 0 $numepochs [1] 0 $currentgen [1] 0 $currentepoch [1] 0 $totalgens [1] 1000 $numdemos [1] 0 $maxlandsize [1] 2e+05 > > ## 2 habitats, 3 stage lifecycle, 1000000 generations, maximum 1000000 individuals > exampleland <- new.landscape.empty() > exampleland <- new.intparam.land(exampleland,h=2,s=2,totgen=1000000,maxland=1000000) > exampleland$intparam $habitats [1] 2 $stages [1] 2 $locusnum [1] 0 $numepochs [1] 0 $currentgen [1] 0 $currentepoch [1] 0 $totalgens [1] 1e+06 $numdemos [1] 0 $maxlandsize [1] 1e+06 > > rm(exampleland) > > > > cleanEx(); ..nameEx <- "new.landscape.empty" > > ### * new.landscape.empty > > flush(stderr()); flush(stdout()) > > ### Name: new.landscape.empty > ### Title: Create a Skeletal Landscape > ### Aliases: new.landscape.empty > ### Keywords: misc > > ### ** Examples > > ## Only usage > new.landscape.empty() $intparam NULL $switchparam NULL $floatparam NULL $demography $demography$localdem NULL $demography$epochs NULL $loci NULL $individuals NULL > > > cleanEx(); ..nameEx <- "new.local.demo" > > ### * new.local.demo > > flush(stderr()); flush(stdout()) > > ### Name: new.local.demo > ### Title: Create a Local Demography > ### Aliases: new.local.demo > ### Keywords: misc > > ### ** Examples > > > exampleS <- matrix(c(0.1, 0, 0.5, 0.3), nrow = 2) > exampleR <- matrix(c(0, 1.1, 0, 0), nrow = 2) > exampleM <- matrix(c(0, 0, 0, 1), nrow = 2) > > exampleland <- new.landscape.empty() > exampleland <- new.intparam.land(exampleland, s=2) > exampleland <- new.floatparam.land(exampleland) > exampleland <- new.switchparam.land(exampleland) > exampleland <- new.local.demo(exampleland,exampleS,exampleR,exampleM) > > exampleland$demography$localdem [[1]] [[1]]$LocalS [,1] [,2] [1,] 0.1 0.5 [2,] 0.0 0.3 [[1]]$LocalR [,1] [,2] [1,] 0.0 0 [2,] 1.1 0 [[1]]$LocalM [,1] [,2] [1,] 0 0 [2,] 0 1 > > rm(exampleS) > rm(exampleR) > rm(exampleM) > rm(exampleland) > > > > cleanEx(); ..nameEx <- "new.locus" > > ### * new.locus > > flush(stderr()); flush(stdout()) > > ### Name: new.locus > ### Title: Add a locus > ### Aliases: new.locus > ### Keywords: misc > > ### ** Examples > > exampleland <- new.landscape.empty() > exampleland <- new.intparam.land(exampleland, s=2, h=2) > exampleland <- new.floatparam.land(exampleland) > exampleland <- new.switchparam.land(exampleland) > > exampleland <- new.locus(exampleland,type=2,ploidy=2,mutationrate=.001,numalleles=5,allelesize=100) > > exampleland$loci [[1]] [[1]]$type [1] 253 [[1]]$ploidy [1] 2 [[1]]$trans [1] 1 [[1]]$rate [1] 0.001 [[1]]$alleles [[1]]$alleles[[1]] [[1]]$alleles[[1]]$aindex [1] 0 [[1]]$alleles[[1]]$birth [1] 0 [[1]]$alleles[[1]]$prop [1] 0.2 [[1]]$alleles[[1]]$state [1] "TTGCACCGGAAAGTCTGCTCCAGATTATCTTGTACGCAGTCGCGGCATGGTCTAAATGGTCTTTGTTCACTCTTTCCTCCTGTTCAGAAAAAGCCCTTCG" [[1]]$alleles[[2]] [[1]]$alleles[[2]]$aindex [1] 1 [[1]]$alleles[[2]]$birth [1] 0 [[1]]$alleles[[2]]$prop [1] 0.2 [[1]]$alleles[[2]]$state [1] "GTTCGAATCGCGTTAAGATGCTTACTGAAGGAAGCGGGCGGGATGTAGACGGTTGAGATATCTCCTATGTGCCTTCGGGCTACGCACGCGGTACTGACTC" [[1]]$alleles[[3]] [[1]]$alleles[[3]]$aindex [1] 2 [[1]]$alleles[[3]]$birth [1] 0 [[1]]$alleles[[3]]$prop [1] 0.2 [[1]]$alleles[[3]]$state [1] "TAGTAGGATGCACCCTGCCTTATGCGTATCTATGTGGGTTTGCATATATCCCTGTAATTCGTTCGAACGAAATATATATCAGCTAATAAAAACTGGAAAC" [[1]]$alleles[[4]] [[1]]$alleles[[4]]$aindex [1] 3 [[1]]$alleles[[4]]$birth [1] 0 [[1]]$alleles[[4]]$prop [1] 0.2 [[1]]$alleles[[4]]$state [1] "GATTTCACATAACGTTATCGGTTCCCCCTCCTTCATTAGCCAGTGTTATGTACTCTCACTATCTGCAGGTTGCAATTCATTGGCAACCACAACGATGTTA" [[1]]$alleles[[5]] [[1]]$alleles[[5]]$aindex [1] 4 [[1]]$alleles[[5]]$birth [1] 0 [[1]]$alleles[[5]]$prop [1] 0.2 [[1]]$alleles[[5]]$state [1] "GACCCGTCACCTGCGTTTGCTGGATTACCCCATGACGATCATGGTTTCAACTTAAGGCGAATATTCGATGTCGTAACTTGCACCGGAACAACTATTTGCA" > > rm(exampleland) > > > > cleanEx(); ..nameEx <- "new.switchparam.land" > > ### * new.switchparam.land > > flush(stderr()); flush(stdout()) > > ### Name: new.switchparam.land > ### Title: Create a set of boolean parameters > ### Aliases: new.switchparam.land > ### Keywords: misc > > ### ** Examples > > ## Defaults > exampleland <- new.landscape.empty() > exampleland <- new.switchparam.land(exampleland) > exampleland$switchparam $randepoch [1] 0 $randdemo [1] 0 $multp [1] 1 > > ## Random epochs, random demographies, and no multiple paternity > exampleland <- new.landscape.empty() > exampleland <- new.switchparam.land(exampleland,re=1,rd=1,mp=0) > exampleland$switchparam $randepoch [1] 1 $randdemo [1] 1 $multp [1] 0 > > rm(exampleland) > > > > cleanEx(); ..nameEx <- "obs.het.landscape" > > ### * obs.het.landscape > > flush(stderr()); flush(stdout()) > > ### Name: obs.het.landscape > ### Title: Calculate observed heterozygosity > ### Aliases: obs.het.landscape > ### Keywords: misc > > ### ** Examples > > exampleland <- new.example.landscape() > exampleland <- simulate.landscape(exampleland, 4) > obshet <- obs.het.landscape(exampleland) > rm(exampleland) > > > > cleanEx(); ..nameEx <- "populations" > > ### * populations > > flush(stderr()); flush(stdout()) > > ### Name: populations > ### Title: return a vector of population IDs from a landscape > ### Aliases: populations > ### Keywords: misc > > ### ** Examples > > exampleland <- new.example.landscape() > exampleland <- simulate.landscape(exampleland, 4) > hist(populations(exampleland),main="Distribution of population size in landscape") > rm(exampleland) > > > > cleanEx(); ..nameEx <- "read.landscape" > > ### * read.landscape > > flush(stderr()); flush(stdout()) > > ### Name: read.landscape > ### Title: Load a landscape from a file > ### Aliases: read.landscape > ### Keywords: misc > > ### ** Examples > > ## Needs write access to the current directory, files created!! > write.landscape(new.example.landscape(), "exampleland.lnd") [1] 0 > exampleland <- read.landscape("exampleland.lnd") > exampleland $intparam $intparam$habitats [1] 2 $intparam$stages [1] 2 $intparam$locusnum [1] 3 $intparam$numepochs [1] 1 $intparam$currentgen [1] 0 $intparam$currentepoch [1] 0 $intparam$totalgens [1] 1000 $intparam$numdemos [1] 1 $intparam$maxlandsize [1] 2e+05 $switchparam $switchparam$randepoch [1] 0 $switchparam$randdemo [1] 0 $switchparam$multp [1] 0 $floatparam $floatparam$selfing [1] 0 $demography $demography$localdem $demography$localdem[[1]] $demography$localdem[[1]]$LocalS [,1] [,2] [1,] 0 0 [2,] 1 0 $demography$localdem[[1]]$LocalR [,1] [,2] [1,] 0 1.1 [2,] 0 0.0 $demography$localdem[[1]]$LocalM [,1] [,2] [1,] 0 0 [2,] 0 1 $demography$epochs $demography$epochs[[1]] $demography$epochs[[1]]$RndChooseProb [1] 1 $demography$epochs[[1]]$StartGen [1] 0 $demography$epochs[[1]]$Extinct [1] 0 0 $demography$epochs[[1]]$Carry [1] 1000 1000 $demography$epochs[[1]]$Localprob [1] 1 $demography$epochs[[1]]$S [,1] [,2] [,3] [,4] [1,] 0 0 0 0 [2,] 0 0 0 0 [3,] 0 0 0 0 [4,] 0 0 0 0 $demography$epochs[[1]]$R [,1] [,2] [,3] [,4] [1,] 0 0 0 0 [2,] 0 0 0 0 [3,] 0 0 0 0 [4,] 0 0 0 0 $demography$epochs[[1]]$M [,1] [,2] [,3] [,4] [1,] 0 0 0 0 [2,] 0 0 0 0 [3,] 0 0 0 0 [4,] 0 0 0 0 $loci $loci[[1]] $loci[[1]]$type [1] 251 $loci[[1]]$ploidy [1] 2 $loci[[1]]$trans [1] 0 $loci[[1]]$rate [1] 0.001 $loci[[1]]$alleles $loci[[1]]$alleles[[1]] $loci[[1]]$alleles[[1]]$aindex [1] 0 $loci[[1]]$alleles[[1]]$birth [1] 0 $loci[[1]]$alleles[[1]]$prop [1] 0.21 $loci[[1]]$alleles[[1]]$state [1] 1 $loci[[1]]$alleles[[2]] $loci[[1]]$alleles[[2]]$aindex [1] 1 $loci[[1]]$alleles[[2]]$birth [1] 0 $loci[[1]]$alleles[[2]]$prop [1] 0.21 $loci[[1]]$alleles[[2]]$state [1] 2 $loci[[1]]$alleles[[3]] $loci[[1]]$alleles[[3]]$aindex [1] 2 $loci[[1]]$alleles[[3]]$birth [1] 0 $loci[[1]]$alleles[[3]]$prop [1] 0.195 $loci[[1]]$alleles[[3]]$state [1] 3 $loci[[1]]$alleles[[4]] $loci[[1]]$alleles[[4]]$aindex [1] 3 $loci[[1]]$alleles[[4]]$birth [1] 0 $loci[[1]]$alleles[[4]]$prop [1] 0.145 $loci[[1]]$alleles[[4]]$state [1] 4 $loci[[1]]$alleles[[5]] $loci[[1]]$alleles[[5]]$aindex [1] 4 $loci[[1]]$alleles[[5]]$birth [1] 0 $loci[[1]]$alleles[[5]]$prop [1] 0.24 $loci[[1]]$alleles[[5]]$state [1] 5 $loci[[2]] $loci[[2]]$type [1] 252 $loci[[2]]$ploidy [1] 1 $loci[[2]]$trans [1] 1 $loci[[2]]$rate [1] 0.005 $loci[[2]]$alleles $loci[[2]]$alleles[[1]] $loci[[2]]$alleles[[1]]$aindex [1] 0 $loci[[2]]$alleles[[1]]$birth [1] 0 $loci[[2]]$alleles[[1]]$prop [1] 0.21 $loci[[2]]$alleles[[1]]$state [1] 1 $loci[[2]]$alleles[[2]] $loci[[2]]$alleles[[2]]$aindex [1] 1 $loci[[2]]$alleles[[2]]$birth [1] 0 $loci[[2]]$alleles[[2]]$prop [1] 0.2 $loci[[2]]$alleles[[2]]$state [1] 2 $loci[[2]]$alleles[[3]] $loci[[2]]$alleles[[3]]$aindex [1] 2 $loci[[2]]$alleles[[3]]$birth [1] 0 $loci[[2]]$alleles[[3]]$prop [1] 0.59 $loci[[2]]$alleles[[3]]$state [1] 3 $loci[[3]] $loci[[3]]$type [1] 253 $loci[[3]]$ploidy [1] 2 $loci[[3]]$trans [1] 0 $loci[[3]]$rate [1] 0.007 $loci[[3]]$alleles $loci[[3]]$alleles[[1]] $loci[[3]]$alleles[[1]]$aindex [1] 0 $loci[[3]]$alleles[[1]]$birth [1] 0 $loci[[3]]$alleles[[1]]$prop [1] 0.18 $loci[[3]]$alleles[[1]]$state [1] "TTGCACCGGAAAGTCTGCTCCAGATTATCTTGTACGCAGTCGCGGCATGGTCTAAATGGTCTTTGTTCACTCTTT" $loci[[3]]$alleles[[2]] $loci[[3]]$alleles[[2]]$aindex [1] 1 $loci[[3]]$alleles[[2]]$birth [1] 0 $loci[[3]]$alleles[[2]]$prop [1] 0.155 $loci[[3]]$alleles[[2]]$state [1] "CCTCCTGTTCAGAAAAAGCCCTTCGGTTCGAATCGCGTTAAGATGCTTACTGAAGGAAGCGGGCGGGATGTAGAC" $loci[[3]]$alleles[[3]] $loci[[3]]$alleles[[3]]$aindex [1] 2 $loci[[3]]$alleles[[3]]$birth [1] 0 $loci[[3]]$alleles[[3]]$prop [1] 0.185 $loci[[3]]$alleles[[3]]$state [1] "GGTTGAGATATCTCCTATGTGCCTTCGGGCTACGCACGCGGTACTGACTCTAGTAGGATGCACCCTGCCTTATGC" $loci[[3]]$alleles[[4]] $loci[[3]]$alleles[[4]]$aindex [1] 3 $loci[[3]]$alleles[[4]]$birth [1] 0 $loci[[3]]$alleles[[4]]$prop [1] 0.135 $loci[[3]]$alleles[[4]]$state [1] "GTATCTATGTGGGTTTGCATATATCCCTGTAATTCGTTCGAACGAAATATATATCAGCTAATAAAAACTGGAAAC" $loci[[3]]$alleles[[5]] $loci[[3]]$alleles[[5]]$aindex [1] 4 $loci[[3]]$alleles[[5]]$birth [1] 0 $loci[[3]]$alleles[[5]]$prop [1] 0.195 $loci[[3]]$alleles[[5]]$state [1] "GATTTCACATAACGTTATCGGTTCCCCCTCCTTCATTAGCCAGTGTTATGTACTCTCACTATCTGCAGGTTGCAA" $loci[[3]]$alleles[[6]] $loci[[3]]$alleles[[6]]$aindex [1] 5 $loci[[3]]$alleles[[6]]$birth [1] 0 $loci[[3]]$alleles[[6]]$prop [1] 0.15 $loci[[3]]$alleles[[6]]$state [1] "TTCATTGGCAACCACAACGATGTTAGACCCGTCACCTGCGTTTGCTGGATTACCCCATGACGATCATGGTTTCAA" $individuals [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 0 0 0 0 4 2 0 5 [2,] 0 0 0 2 3 1 4 3 [3,] 0 0 0 1 0 2 2 2 [4,] 0 0 0 4 2 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<- "simulate.landscape" > > ### * simulate.landscape > > flush(stderr()); flush(stdout()) > > ### Name: simulate.landscape > ### Title: Run a simulation for a single landscape through time > ### Aliases: simulate.landscape > ### Keywords: misc > > ### ** Examples > > exampleland <- new.example.landscape() > exampleland <- simulate.landscape(exampleland, 4) > exampleland $intparam $intparam$habitats [1] 2 $intparam$stages [1] 2 $intparam$locusnum [1] 3 $intparam$numepochs [1] 1 $intparam$currentgen [1] 4 $intparam$currentepoch [1] 0 $intparam$totalgens [1] 1000 $intparam$numdemos [1] 1 $intparam$maxlandsize [1] 2e+05 $switchparam $switchparam$randepoch [1] 0 $switchparam$randdemo [1] 0 $switchparam$multp [1] 0 $floatparam $floatparam$selfing [1] 0 $demography $demography$localdem $demography$localdem[[1]] $demography$localdem[[1]]$LocalS [,1] [,2] [1,] 0 0 [2,] 1 0 $demography$localdem[[1]]$LocalR [,1] [,2] [1,] 0 1.1 [2,] 0 0.0 $demography$localdem[[1]]$LocalM [,1] [,2] [1,] 0 0 [2,] 0 1 $demography$epochs $demography$epochs[[1]] $demography$epochs[[1]]$RndChooseProb [1] 1 $demography$epochs[[1]]$StartGen [1] 0 $demography$epochs[[1]]$Extinct [1] 0 0 $demography$epochs[[1]]$Carry [1] 1000 1000 $demography$epochs[[1]]$Localprob [1] 1 $demography$epochs[[1]]$S [,1] [,2] [,3] [,4] [1,] 0 0 0 0 [2,] 1 0 0 0 [3,] 0 0 0 0 [4,] 0 0 1 0 $demography$epochs[[1]]$R [,1] [,2] [,3] [,4] [1,] 0 1.1 0 0.0 [2,] 0 0.0 0 0.0 [3,] 0 0.0 0 1.1 [4,] 0 0.0 0 0.0 $demography$epochs[[1]]$M [,1] [,2] [,3] [,4] [1,] 0 0 0 0 [2,] 0 1 0 0 [3,] 0 0 0 0 [4,] 0 0 0 1 $loci $loci[[1]] $loci[[1]]$type [1] 251 $loci[[1]]$ploidy [1] 2 $loci[[1]]$trans [1] 0 $loci[[1]]$rate [1] 0.001 $loci[[1]]$alleles $loci[[1]]$alleles[[1]] $loci[[1]]$alleles[[1]]$aindex [1] 0 $loci[[1]]$alleles[[1]]$birth [1] 0 $loci[[1]]$alleles[[1]]$prop [1] 0.21 $loci[[1]]$alleles[[1]]$state [1] 1 $loci[[1]]$alleles[[2]] $loci[[1]]$alleles[[2]]$aindex [1] 1 $loci[[1]]$alleles[[2]]$birth [1] 0 $loci[[1]]$alleles[[2]]$prop [1] 0.21 $loci[[1]]$alleles[[2]]$state [1] 2 $loci[[1]]$alleles[[3]] $loci[[1]]$alleles[[3]]$aindex [1] 2 $loci[[1]]$alleles[[3]]$birth [1] 0 $loci[[1]]$alleles[[3]]$prop [1] 0.195 $loci[[1]]$alleles[[3]]$state [1] 3 $loci[[1]]$alleles[[4]] $loci[[1]]$alleles[[4]]$aindex [1] 3 $loci[[1]]$alleles[[4]]$birth [1] 0 $loci[[1]]$alleles[[4]]$prop [1] 0.145 $loci[[1]]$alleles[[4]]$state [1] 4 $loci[[1]]$alleles[[5]] $loci[[1]]$alleles[[5]]$aindex [1] 4 $loci[[1]]$alleles[[5]]$birth [1] 0 $loci[[1]]$alleles[[5]]$prop [1] 0.24 $loci[[1]]$alleles[[5]]$state [1] 5 $loci[[1]]$alleles[[6]] $loci[[1]]$alleles[[6]]$aindex [1] 6 $loci[[1]]$alleles[[6]]$birth [1] 3 $loci[[1]]$alleles[[6]]$prop [1] 0.003048780 $loci[[1]]$alleles[[6]]$state [1] 8 $loci[[2]] $loci[[2]]$type [1] 252 $loci[[2]]$ploidy [1] 1 $loci[[2]]$trans [1] 1 $loci[[2]]$rate [1] 0.005 $loci[[2]]$alleles $loci[[2]]$alleles[[1]] $loci[[2]]$alleles[[1]]$aindex [1] 0 $loci[[2]]$alleles[[1]]$birth [1] 0 $loci[[2]]$alleles[[1]]$prop [1] 0.21 $loci[[2]]$alleles[[1]]$state [1] 1 $loci[[2]]$alleles[[2]] $loci[[2]]$alleles[[2]]$aindex [1] 1 $loci[[2]]$alleles[[2]]$birth [1] 0 $loci[[2]]$alleles[[2]]$prop [1] 0.2 $loci[[2]]$alleles[[2]]$state [1] 2 $loci[[2]]$alleles[[3]] $loci[[2]]$alleles[[3]]$aindex [1] 2 $loci[[2]]$alleles[[3]]$birth [1] 0 $loci[[2]]$alleles[[3]]$prop [1] 0.59 $loci[[2]]$alleles[[3]]$state [1] 3 $loci[[2]]$alleles[[4]] $loci[[2]]$alleles[[4]]$aindex [1] 3 $loci[[2]]$alleles[[4]]$birth [1] 3 $loci[[2]]$alleles[[4]]$prop [1] 0.003484321 $loci[[2]]$alleles[[4]]$state [1] 4 $loci[[3]] $loci[[3]]$type [1] 253 $loci[[3]]$ploidy [1] 2 $loci[[3]]$trans [1] 0 $loci[[3]]$rate [1] 0.007 $loci[[3]]$alleles $loci[[3]]$alleles[[1]] $loci[[3]]$alleles[[1]]$aindex [1] 0 $loci[[3]]$alleles[[1]]$birth [1] 0 $loci[[3]]$alleles[[1]]$prop [1] 0.18 $loci[[3]]$alleles[[1]]$state [1] "TTGCACCGGAAAGTCTGCTCCAGATTATCTTGTACGCAGTCGCGGCATGGTCTAAATGGTCTTTGTTCACTCTTT" $loci[[3]]$alleles[[2]] $loci[[3]]$alleles[[2]]$aindex [1] 1 $loci[[3]]$alleles[[2]]$birth [1] 0 $loci[[3]]$alleles[[2]]$prop [1] 0.155 $loci[[3]]$alleles[[2]]$state [1] "CCTCCTGTTCAGAAAAAGCCCTTCGGTTCGAATCGCGTTAAGATGCTTACTGAAGGAAGCGGGCGGGATGTAGAC" $loci[[3]]$alleles[[3]] $loci[[3]]$alleles[[3]]$aindex [1] 2 $loci[[3]]$alleles[[3]]$birth [1] 0 $loci[[3]]$alleles[[3]]$prop [1] 0.185 $loci[[3]]$alleles[[3]]$state [1] "GGTTGAGATATCTCCTATGTGCCTTCGGGCTACGCACGCGGTACTGACTCTAGTAGGATGCACCCTGCCTTATGC" $loci[[3]]$alleles[[4]] $loci[[3]]$alleles[[4]]$aindex [1] 3 $loci[[3]]$alleles[[4]]$birth [1] 0 $loci[[3]]$alleles[[4]]$prop [1] 0.135 $loci[[3]]$alleles[[4]]$state [1] "GTATCTATGTGGGTTTGCATATATCCCTGTAATTCGTTCGAACGAAATATATATCAGCTAATAAAAACTGGAAAC" $loci[[3]]$alleles[[5]] $loci[[3]]$alleles[[5]]$aindex [1] 4 $loci[[3]]$alleles[[5]]$birth [1] 0 $loci[[3]]$alleles[[5]]$prop [1] 0.195 $loci[[3]]$alleles[[5]]$state [1] "GATTTCACATAACGTTATCGGTTCCCCCTCCTTCATTAGCCAGTGTTATGTACTCTCACTATCTGCAGGTTGCAA" $loci[[3]]$alleles[[6]] $loci[[3]]$alleles[[6]]$aindex [1] 5 $loci[[3]]$alleles[[6]]$birth [1] 0 $loci[[3]]$alleles[[6]]$prop [1] 0.15 $loci[[3]]$alleles[[6]]$state [1] "TTCATTGGCAACCACAACGATGTTAGACCCGTCACCTGCGTTTGCTGGATTACCCCATGACGATCATGGTTTCAA" $loci[[3]]$alleles[[7]] $loci[[3]]$alleles[[7]]$aindex [1] 7 $loci[[3]]$alleles[[7]]$birth [1] 2 $loci[[3]]$alleles[[7]]$prop [1] 0.003921569 $loci[[3]]$alleles[[7]]$state [1] "GATTTCACATAACGTTATCGGTTCCCCCTCCTTCATTAGACAGTGTTATGTACTCTCACTATCTGCAGGTTGCAA" $loci[[3]]$alleles[[8]] $loci[[3]]$alleles[[8]]$aindex [1] 9 $loci[[3]]$alleles[[8]]$birth [1] 2 $loci[[3]]$alleles[[8]]$prop [1] 0.002849003 $loci[[3]]$alleles[[8]]$state [1] "GATTTCACATAACGTTATCGGTTCCCCCTCCTTCATTAGCCAGTGTTATGTACTCTCAATATCTGCAGGTTGCAA" $individuals [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1 0 3 2 2 2 3 5 [2,] 1 0 3 0 1 2 3 4 [3,] 1 0 3 2 4 2 0 2 [4,] 1 0 3 0 4 2 1 3 [5,] 1 0 3 2 2 2 0 5 [6,] 1 0 3 2 4 2 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,] 3 0 3 2 2 2 0 1 [154,] 3 0 3 1 4 2 2 4 > rm(exampleland) > > > > cleanEx(); ..nameEx <- "theta.h.landscape" > > ### * theta.h.landscape > > flush(stderr()); flush(stdout()) > > ### Name: theta.h.landscape > ### Title: Calculate theta using heterozygosity > ### Aliases: theta.h.landscape > ### Keywords: misc > > ### ** Examples > > > exampleland <- new.example.landscape() > exampleland <- simulate.landscape(exampleland, 4) > > library(ape) > theta.h.mat <- theta.h.landscape(exampleland) > theta.h.mat [,1] [,2] [,3] [1,] 0.5778629 0.4013929 0.6120151 [2,] 0.5880583 0.4550988 0.6062784 > > > > cleanEx(); ..nameEx <- "theta.k.landscape" > > ### * theta.k.landscape > > flush(stderr()); flush(stdout()) > > ### Name: theta.k.landscape > ### Title: Calculate theta using the number of alleles > ### Aliases: theta.k.landscape > ### Keywords: misc > > ### ** Examples > > exampleland <- new.example.landscape() > exampleland <- simulate.landscape(exampleland, 4) > > library(ape) > theta.k.mat <- theta.k.landscape(exampleland) > theta.k.mat [,1] [,2] [,3] [1,] 1.0935567 0.4588512 1.631097 [2,] 0.8501864 0.7316279 1.100841 > > > > cleanEx(); ..nameEx <- "theta.s.landscape" > > ### * theta.s.landscape > > flush(stderr()); flush(stdout()) > > ### Name: theta.s.landscape > ### Title: Calculate theta using segregating sites > ### Aliases: theta.s.landscape > ### Keywords: misc > > ### ** Examples > > exampleland <- new.example.landscape() > exampleland <- simulate.landscape(exampleland, 4) > > library(ape) > theta.s.mat <- theta.s.landscape(exampleland) [1] "len statevec 8" [1] 75 [1] "len statevec 6" [1] 75 > theta.s.mat [,1] [,2] [,3] [1,] NA NA 15.34363 [2,] NA NA 15.34363 > > > > cleanEx(); ..nameEx <- "write.landscape" > > ### * write.landscape > > flush(stderr()); flush(stdout()) > > ### Name: write.landscape > ### Title: Save a landscape to a file > ### Aliases: write.landscape > ### Keywords: misc > > ### ** Examples > > ## Needs write access to the current directory, files created!! > exampleland <- new.example.landscape() > write.landscape(exampleland, "exampleland.lnd") [1] 0 > > rm(exampleland) > > > > cleanEx(); ..nameEx <- "write.landscape.foreign" > > ### * write.landscape.foreign > > flush(stderr()); flush(stdout()) > > ### Name: write.landscape.foreign > ### Title: Save a landscape to a file in a foreign format > ### Aliases: write.landscape.foreign > ### Keywords: misc > > ### ** Examples > > ## Needs write access to the current directory, files created!! > exampleland <- new.example.landscape() > write.landscape.foreign(exampleland, fn="exampleland.nex", fmt="GDA") > rm(exampleland) > > > > ### *