View source: R/sim_island_with_mainland.R
sim_island_with_mainland | R Documentation |
This function simulates islands with given cladogenesis, extinction, carrying capacity, immigration and anagenesis parameters, and simulates the mainland given an extinction rate parameter, all of which are modelled as time-constant parameters.
sim_island_with_mainland(
total_time,
m,
island_pars,
mainland_ex,
mainland_sample_prob,
mainland_sample_type,
replicates,
verbose = FALSE
)
total_time |
Numeric defining the length of the simulation in time units. |
m |
Numeric defining the size of mainland pool. |
island_pars |
A numeric vector containing the parameters for the island:
|
mainland_ex |
Numeric parameter for mainland extinction rate. |
mainland_sample_prob |
Numeric between zero and one determining the probability of an extant mainland species being sampled. |
mainland_sample_type |
String either "unsampled" for unsampled known species on the mainland, "undiscovered" for undiscovered species on the mainland, or "complete" if the mainland sampling probability is one. |
replicates |
Integer specifying number of island replicates to be simulated. |
verbose |
Logical, determining if progress output should be printed during the simulation. |
A list. The highest level of the list has two elements called
ideal_islands
and empirical_islands
which corresponds to
the ideal and empirical data sets produce in each simulation. Within each
ideal_islands
and empirical_islands
each element is an
individual replicate. The first element of each replicate is composed of
island information containing:
$island_age
A numeric with the island age.
$not_present
the number of mainland lineages that are not present on the island.
The subsequent elements of the list pertaining to each replicate contain information on a single colonist lineage on the island and have 3 components:
$branching_times
island age and stem age of the population/species in the case of Non-endemic, Non-endemic_MaxAge and Endemic anagenetic species. For cladogenetic species these should be island age and branching times of the radiation including the stem age of the radiation.
$stac
An integer ranging from 1 to 6 indicating the status of the colonist:
Non_endemic_MaxAge
Endemic
Endemic&Non_Endemic
Non_endemic_MaxAge
Endemic_singleton_MaxAge
Endemic_clade_MaxAge
missing_species
number of island species that were not sampled for particular clade (only applicable for endemic clades)
Joshua W. Lambert
## Simulate 2 islands (replicates) for 1 million years, with a mainland
## extinction rate of 1 (SpMy^-1). Pool size 100.
set.seed(
1,
kind = "Mersenne-Twister",
normal.kind = "Inversion",
sample.kind = "Rejection"
)
island <- sim_island_with_mainland(
total_time = 1,
m = 100,
island_pars = c(1, 1, 10, 0.1, 1),
mainland_ex = 1,
mainland_sample_prob = 1,
mainland_sample_type = "undiscovered",
replicates = 2,
verbose = FALSE
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.