Description Usage Arguments Value Author(s) References See Also Examples
hotspots
map areas or grid cells with highest values for a biodiversity metric e.g.
species richness, species endemism or degree of threat.
1 |
x |
A data frame |
values |
Variable in the dataframe on which to compute hotspots analysis |
prob |
The threshold quantile for representing the highest proportion of biodiversity
in an area. By default, the threshold is set to |
... |
Further arguments passed to or from other methods. |
values |
Integers of 1s and 0s with 1 corresponding to the hotspots |
Barnabas H. Daru darunabas@gmail.com
myers2000biodiversitybioregion
\insertReforme2005globalbioregion
\insertRefCeballos19374bioregion
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | require(raster); require(colorRamps); require(data.table)
s <- readRDS(system.file("nigeria/NG_comm.rds", package= "bioregion"))
Endm <- weighted.endemism(s)
H <- hotspots(Endm, values = Endm$V1)
## To plot hotspots on the map, first create a polygon shapefile
gr <- readRDS(system.file("nigeria/NG_grids.rds", package= "bioregion"))
m <- merge(gr, H, by="grids")
m <- m[!is.na(m@data$values),]
pol <- readRDS(system.file("nigeria/nigeria.rds", package= "bioregion"))
par(mfrow = c(2,1)); plot(pol, border="grey", col="lightgrey")
plot(m[(m@data$values==1),], col="red", add=TRUE, border=NA)
title("Hotspots of Weighted Endemism", line = 1, cex=1, adj=0.05)
k=10
COLOUR <- blue2green2red(k)
y = choropleth(m, values = m$V1)
plot(y, col=COLOUR[y$values], border = NA);
title("Overall Weighted Endemism", line = 1, cex=1, adj=0.05)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.