nodeEstimateEnvelopes {ppgm} | R Documentation |
nodeEstimateEnvelopes
Description
This function estimates climate envelopes at nodes with the optional placement of fossils on randomly assigned or specified edges on a tree.
Usage
nodeEstimateEnvelopes(treedata_min, treedata_max, fossils=FALSE,
fossils.edges=FALSE, model="BM", bounds=list(), control=list(),
use.paleoclimate = TRUE, paleoclimateUser = NULL, layerAge = c(0:20),
which.biovars = which.biovars)
Arguments
treedata_min |
tree data object with min estimate of the climate envelope – list where first object is phylogeny, and second object is array of species with climate data variables (species must match) |
treedata_max |
tree data object with max estimate of the climate envelope |
fossils |
a matrix with three columns of age, longitude, and latitude, in that order, and rows that are entries for fossil occurrences. |
fossils.edges |
the edge number that the fossil occurs on |
model |
the model of evolution to use in the ancestral state reconstruction. Options are "estimate", "BM", "OU", "EB", "lambda", "kappa", "delta". |
bounds |
bounds used for the model, passes to |
control |
setting used for optimization of the model likelihood. Passes to |
use.paleoclimate |
if left blank, default North America paleoclimate data is used. If FALSE, user submitted paleoclimate must be provided |
paleoclimateUser |
list of data frames with paleoclimates, must be dataframes with columns: GlobalID, Longitude, Latitude, bio1, bio2,...,bio19. (see |
layerAge |
vector with the ages of the paleoclimate dataframes, if using user submitted paleoclimate data |
which.biovars |
A vector of the numbers of the bioclimate variables that should be returned. The bioclimate variables number correspond to the Hijmans table at (https://www.worldclim.org/data/bioclim.html). |
Details
function adds fossils to trees according to addFossil()
, then passes to nodeEstimate()
.
Value
an object of the class "nodeEstimate".
model
if model = "estimate", the best fit model of evolution. If the model was specified, then model is the specified model.
est
the ancestral node estimates of the continuous character.
phy
the phylogeny used for the estimates, which might be transformed depending on the evolutionary model.
BM
if model = "BM", returned values from fitContinuous()
where the model is "BM"
OU
if model = "OU", returned values from fitContinuous()
where the model is "OU"
EB
if model = "EB", returned values from fitContinuous()
where the model is "EB"
lambda
if model = "lambda", returned values from fitContinuous()
where the model is "lambda"
kappa
if model = "kappa", returned values from fitContinuous()
where the model is "kappa"
delta
if model = "delta", returned values from fitContinuous()
where the model is "delta"
fitted
if model = "estimate", returned values from the best fit model of evolution.
Author(s)
A. Michelle Lawing, Alexandra F. C. Howard
See Also
nodeEstimate
, fitContinuous
Examples
data(sampletrees)
sampletrees <- sample(sampletrees,5)
data(occurrences)
occu <- getBioclimVars(occurrences, which.biovars=c(1,2))
sp_data_min<-sapply(4:5,function(x) tapply(occu[,x],occu$Species,min))
sp_data_max<-sapply(4:5,function(x) tapply(occu[,x],occu$Species,max))
ex_min <- geiger::treedata(sampletrees[[1]], sp_data_min, sort=TRUE)
ex_max <- geiger::treedata(sampletrees[[1]], sp_data_max, sort=TRUE)
colnames(ex_min$data)<- colnames(ex_max$data)<-c("bio1","bio2") #labels biovars
nodeest<- nodeEstimateEnvelopes(treedata_min=ex_min,treedata_max=ex_max,
model="BM",which.biovars=c(1,2),
bounds=list(sigsq = c(min = 0, max = 1000000)))