View source: R/make.functions.R
make.linear.decay | R Documentation |
Create a linear decay function for genetic distance of two taxa and the probability of success of a hybridization event
make.linear.decay(threshold)
threshold |
A numeric representing how quickly the hybridization success decays. Smaller values denote a quicker decay |
The function computes:
1-\frac{d}{t}
where d is the genetic distance between taxa
A linear decay function
a distance d
greater than t
will return 0
set.seed(17)
dist_func<- make.linear.decay(0.5)
net<-sim.bdh.age(1,1,5,2,2,c(1/3,1/3,1/3),hyb.inher.fxn = make.uniform.draw(),
hyb.rate.fxn=dist_func,complete=TRUE)[[1]]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.