Learn R Programming

RPANDA (version 2.3)

lines.fit_t.env: Add to a plot line segments joining the phenotypic evolutionary rate through time estimated by the fit_t_env function

Description

Plot estimated evolutionary rate as a function of the environmental data and time.

Usage

# S3 method for fit_t.env
lines(x, steps = 100, ...)

Value

lines.fit_t.env returns invisibly a list with the following components used to add the line segments to the current plot:

time_steps

the times steps where the climatic function was evaluated to compute the rate. The number of steps is controlled through the argument steps.

rates

the estimated evolutionary rate through time estimated at each time_steps

Arguments

x

an object of class 'fit_t.env' obtained from a fit_t_env fit.

steps

the number of steps from the root to the present used to compute the evolutionary rate \(\sigma2\) through time.

...

further arguments to be passed to plot. See ?plot.

Author

J. Clavel

References

Clavel, J. & Morlon, H., 2017. Accelerated body size evolution during cold climatic periods in the Cenozoic. Proceedings of the National Academy of Science, 114(16): 4183-4188.

See Also

plot.fit_t.env, likelihood_t_env

Examples

Run this code
test = FALSE
if(test){
# \donttest{
data(Cetacea)
data(InfTemp)

# Plot estimated evolutionary rate as a function of the environmental data and time.
set.seed(123)
trait <- sim_t_env(Cetacea, param=c(0.1,-0.2), env_data=InfTemp, model="EnvExp", 
					root.value=0, step=0.01, plot=TRUE)


## Fit the Environmental-exponential model with different smoothing parameters

result1=fit_t_env(Cetacea, trait, env_data=InfTemp, scale=TRUE)
result2=fit_t_env(Cetacea, trait, env_data=InfTemp, scale=TRUE, df=10)

# first plot result1
plot(result1, lwd=3)

# add result2 to the current plot
lines(result2, lty=2, lwd=3, col="red")
# }
}

Run the code above in your browser using DataLab