testPophist | R Documentation |
Function to take output from getpophist_cells and def_grid and test for cell occupancy
testPophist(ph, landscape)
ph |
a pophist object, output by getpophist2.cells() |
landscape |
the landscape object used in the forward simulation |
All cells with population genetic samples must be colonized during the forward simulation. Simulations that do not fully colonize sampled populations are discarded. This function tests three aspects of the lansdcape produced in the forward demographic simulation:
All populations with genetic samples are colonized during the forward simulation.
Habitat suitability is non-zero at the last simulation time step in all cells with genetic samples.
The spatial extent of the simulated landscape matches that of the genetic samples.
Returns a logical (T or F) indicating whether all sampled cells are occupied at the end of the forward simulation.
ashSetupLandscape
, getpophist2.cells
, make.gmap
, pophist.aggregate
, runFSC_step_agg3
library(holoSimCell)
parms <- drawParms(control = system.file("extdata/ashpaper","Ash_priors.csv",package="holoSimCell"))
load(file=paste0(system.file(package="holoSimCell"),"/extdata/landscapes/",pollenPulls[[1]]$file))
refpops <- pollenPulls[[1]]$refs
avgCellsz <- mean(c(res(landscape$sumrast)))
ph = getpophist2.cells(h = landscape$details$ncells, xdim = landscape$details$x.dim, ydim = landscape$details$y.dim,
landscape=landscape,
refs=refpops,
refsz=parms$ref_Ne,
lambda=parms$lambda,
mix=parms$mix,
shortscale=parms$shortscale*avgCellsz,
shortshape=parms$shortshape,
longmean=parms$longmean*avgCellsz,
ysz=res(landscape$sumrast)[2],
xsz=res(landscape$sumrast)[1],
K = parms$Ne)
testPophist(ph, landscape)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.