getLineageClimate {ppgm}R Documentation

getLineageClimate

Description

This function calculates the suitable climate for each specific lineage, starting at the tips and going back through time to the root.

Usage

getLineageClimate(envelope, tree, which.biovars, 
use.paleoclimate=TRUE, paleoclimateUser=NULL, layerAge=c(0:20))

Arguments

envelope

the min and max climate envelope of each lineage for each time slice, as outputted by getEnvelopes()

tree

the phylogeny of all species. An object of class phylo

which.biovars

a vector of the numbers of the bioclimate variables to be included. The bioclimate variables number correspond to the table at (https://www.worldclim.org/data/bioclim.html).

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 getBioclimvars()).

layerAge

vector with the ages of the paleoclimate dataframes, if using user submitted paleoclimate data

Details

Calculates rate of geographic change of all lineages. Outputs both the geographic center change, and the geographic size change.

Value

matchedClim list of occurrences points for each lineage, for each time slice of paleoclimate data

lineage list of lineage specific nodes, as output from phangorn::Ancestors

Author(s)

A. Michelle Lawing, Alexandra F. C. Howard, Maria A. Hurtado-Materon

See Also

getEnvelopes() getGeoRate()

Examples

data(sampletrees)
data(occurrences)
data(paleoclimate)
occu <- getBioclimVars(occurrences, which.biovars=1)
tree <- sampletrees[[25]]
#species minimum for biovariable 1
sp_data_min<- tapply(occu[,4],occu$Species,min)
#species maximum for biovariable 1
sp_data_max<- tapply(occu[,4],occu$Species,max)
#convert to treedata object
treedata_min <- geiger::treedata(tree,sp_data_min,sort=TRUE,warnings=F) 
treedata_max <- geiger::treedata(tree,sp_data_max,sort=TRUE,warnings=F)
#estimate node values using Brownian Motion
full_est <- nodeEstimateEnvelopes(treedata_min,treedata_max)
node_est <- full_est$est #extract only node estimates
#calculate climate envelopes
example_getEnvelopes <- getEnvelopes(treedata_min, treedata_max, node_est)
#calculate lineage specific climate
example_getLinClim <- getLineageClimate(example_getEnvelopes, tree, which.biovars=1)

[Package ppgm version 1.0.3 Index]