getTimeSlice {ppgm} | R Documentation |
getTimeSlice
Description
This function extracts estimated ancestral reconstructions for continuous characters any time specified along a phylogeny for all lineages present at the specified time.
Usage
getTimeSlice(timeSlice, tree, trait, model = "BM", plot.est = FALSE)
Arguments
timeSlice |
single numeric or a vector with the time (or times) to extract the estimated ancestor reconstructions. |
tree |
an object of the class "phylo" that should be dated |
trait |
a vector of both tip values and node estimates that correspond to tree |
model |
if model = "estimate", the best fit model of evolution. If the model was specified, then model is the specified model, passes to |
plot.est |
a conditional stating whether or not to plot the results |
Details
The estimated reconstruction relies on an interpolation between node or between tip and node estimates of the trait. This method assumes a constant rate of evolution along the lineage where the interpolation is taking place.
Value
edge
for each time specified, a vector of edges that are present during that time are returned
est
for each time specified, a vector of estimates of the ancestral reconstruction along each edge
Author(s)
A. Michelle Lawing, Alexandra F. C. Howard
See Also
geiger::fitContinuous()
, nodeEstimate()
Examples
data(sampletrees)
data(occurrences)
occurrences <- getBioclimVars(occurrences, which.biovars=1)
sp_data_min<- tapply(occurrences[,4],occurrences$Species,min)
treedata_min <- geiger::treedata(sampletrees[[1]], sp_data_min)
ex_est <- nodeEstimate(treedata_min, 1, model = 'BM') #runs BM model
ex_timeSlice <- getTimeSlice(10,treedata_min$phy,c(treedata_min$data[,1],ex_est$est))