Description Usage Arguments Author(s)
View source: R/ms_sim_function.R
Function to conduct landscape simulation with NLMR and genetic simulation with CDPOP
This function will compile the inputs, run CDPOP, and return the relevant data objects for future use. All generated files are also saved to the specified working directory.
** NOTE: CDPOP requires Python 2.7 to run. You will need to have this version of Python installed, along with the necessary libraries (see the CDPOP manual). CDPOP itself is part if the 'radishDGS' package.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | cdpop_sim(
master_seed,
covariates,
conductance_quantile_for_demes = 0.4,
effect_size,
number_of_demes = 150,
sampled_proportion_of_demes = 0.5,
deme_size = 10,
proportion_deme_sampled = 0.5,
buffer_size = 0.15,
MeanFecundity = 4,
iter = NULL,
sim_dir,
looptime = 201,
output_years = 200,
loci = 20,
alleles = 20,
matemovethresh = 0.05,
python = NULL
)
|
master_seed |
Seed value. This is important to set when wanting keep the same locations of points across simulations, but vary some other dimension(s) of the simulation (e.g., dispersal) |
covariates |
Raster stack of input surface(s) |
conductance_quantile_for_demes |
Threshold to set for the proportion of the landscape that is 'good' habitat where points will be distributed during simulation (Default = 0.4) |
effect_size |
Effect size(s) of surfaces in conductance model |
number_of_demes |
Number of demes/spatial locations to simulate (Default = 150) |
sampled_proportion_of_demes |
Number of demes/individuals to randomly select from those simulated (Default = 0.5) |
deme_size |
Number of individuals in each deme (Default = 10) |
proportion_deme_sampled |
Proportion of individuals within each deme to be randomly sampled (Default = 0.5) |
buffer_size |
Buffer to filter/exclude edge demes from the analysis (Default = 0.15). Peripheral populations will not be selected. |
MeanFecundity |
Mean number of offspring produced by each female. Follows a Poisson process (Default = 4) |
iter |
Can specify the iteration number of a for loop. Will be used in naming output folders. If not specified, the time stamp will be used |
sim_dir |
Main directory where simulation results will be written |
looptime |
Total number of steps ('generations') in CDPOP simulations (Default = 201) |
output_years |
The year(s) that you want CDPOP to write simulation results to file (Default = 200) |
loci |
Number of microsatellite loci to simulate (Default = 20) |
alleles |
Number of alleles at each locus to simulate (Default = 20) |
matemovethresh |
Dispersal threshold value (Default = 0.05). This is the quantile threshold of all resistance distances |
python |
Optional. Only needed if Python 2.7 is not in your system path. If needed, specify the full path to the Python 2.7x program file. |
Bill Peterman
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.