50% off | Unlimited Data & AI Learning
Get 50% off unlimited learning

ppgm (version 1.1)

plotGeoRates: plotGeoRates

Description

plotGeoRates

Usage

plotGeoRates(geo_center, geo_size, time_int, trees, path="")

Value

plots of geo rate

Arguments

geo_center

change in geographic center of suitable climate envelope, see

geo_size

change in geographic size of suitable climate envelope

time_int

time intervals to plot

trees

distribution of phylogenies

path

path to the directory where the results to be saved

Author

A. Michelle Lawing, Alexandra F. C. Howard

Details

Creates plot with gray background of all pairwise comparisons of change in geo center and area through time. Blue points on top show the sequential change in geo center and expansion/contraction for all lineages

See Also

getGeoRates

Examples

Run this code
data(sampletrees)
data(occurrences)
sampletrees <- sample(sampletrees,5)
biooccu <- getBioclimVars(occurrences, which.biovars=1)
sp_data_min<- tapply(biooccu[,4],biooccu$Species,min)
sp_data_max<- tapply(biooccu[,4],biooccu$Species,max)
treedata_min <- treedata_max <- node_est <- envelope <- list()
geo_center<-array(NA,dim=c(100,53,21,21))
geo_size<-array(NA,dim=c(100,53,21,21))
for (tr in 1:length(sampletrees)){
  treedata_min[[tr]] <- geiger::treedata(sampletrees[[tr]],sp_data_min,sort=TRUE,warnings=F)
  treedata_max[[tr]] <- geiger::treedata(sampletrees[[tr]],sp_data_max,sort=TRUE,warnings=F)
  full_est <- nodeEstimateEnvelopes(treedata_min[[tr]],treedata_max[[tr]])
  node_est[[tr]] <- full_est$est
  envelope[[tr]] <- getEnvelopes(treedata_min[[tr]], treedata_max[[tr]], node_est[[tr]])
  temp <- getGeoRate(envelope[[tr]], sampletrees[[tr]], which.biovars=1)
  geo_center[tr,,,]<-temp$geo_center
  geo_size[tr,,,]<-temp$geo_size
}

if (FALSE) plotGeoRates(geo_center, geo_size, temp$time_int, sampletrees, path="tempdir()")

Run the code above in your browser using DataLab