plotGeoRates | R Documentation |
plotGeoRates
plotGeoRates(geo_center, geo_size, time_int, trees, path="")
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 |
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
plots of geo rate
A. Michelle Lawing, Alexandra F. C. Howard
getGeoRates
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
}
## Not run: plotGeoRates(geo_center, geo_size, temp$time_int, sampletrees, path="tempdir()")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.