plot_fit_env | R Documentation |
Plot estimated speciation, extinction & net diversification rates as a function of the environmental data and time
plot_fit_env(fit.env, env_data, tot_time)
fit.env |
an object of class 'fit.env', output of the 'fit_env' function |
env_data |
environmental data, given as a data frame with two columns. The first column is time, the second column is the environmental data (temperature for instance). |
tot_time |
the age of the phylogeny (crown age, or stem age if known). If working with crown ages, tot_time is given by max(node.age(phylo)$ages). |
Plots representing how the estimated speciation, extinction & net diversification rate functions vary as a function of the environmental data & time
H Morlon and FL Condamine
fit_env
if(require(pspline)){
data(Balaenopteridae)
tot_time<-max(node.age(Balaenopteridae)$ages)
data(InfTemp)
dof<-smooth.spline(InfTemp[,1], InfTemp[,2])$df
# Fit the pure birth model (no extinction) with exponential variation of the speciation rate
# with temperature.
f.lamb <-function(t,x,y){y[1] * exp(y[2] * x)}
f.mu<-function(t,x,y){0}
lamb_par<-c(0.10, 0.01)
mu_par<-c()
result <- fit_env(Balaenopteridae,InfTemp,tot_time,f.lamb,f.mu,
lamb_par,mu_par,f=1, fix.mu=TRUE, df=dof, dt=1e-3)
# plot fitted rates
plot_fit_env(result, InfTemp, tot_time)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.