Plot the overlap metric
Plots the posterior distribution of the niche region overlap metric calculated for each pairwise combination of species.
overlap.plot(over.stat, nbreaks = 50, equal.axis = FALSE, species.names, col, mean.cred = TRUE, mean.cred.col = "green", xlab)
over.stat |
an array with |
nbreaks |
number of breaks in the histogram. Defaults to 50. |
equal.axis |
logical. If |
species.names |
a vector of species names. Defaults to |
col |
a vector of the colours in which each species will be drawn. |
mean.cred |
logical. If |
mean.cred.col |
colour of the mean and credible interval lines in the histogram. |
xlab |
optional plot title, located on the bottom. Default is no title. |
This function uses the overlap metric information in over.stat
calculated by overlap
to create 2-dimensional plots of interspecific niche region overlap.
Returns a series of histograms illustrating the probability of pairwise species overlap.
# fish data data(fish) # parameter draws from the "default" posteriors of each fish nsamples <- 500 system.time({ fish.par <- tapply(1:nrow(fish), fish$species, function(ii) niw.post(nsamples = nsamples, X = fish[ii,2:4])) }) # overlap calculation system.time({ over <- overlap(fish.par, nreps = nsamples, nprob = nsamples, alpha = c(.95, .99)) }) # overlap plot clrs <- c("black", "red", "blue", "orange") # color for each species ii <- 1 # which niche region alpha level to use overlap.plot(over[,,,ii], col = clrs, mean.cred.col = "turquoise", xlab = paste0("Overlap Probability (%) -- Niche Region Size: ", dimnames(over)[[4]][ii]))
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.