biomes ships spatially explicit raster layers of 31 published global terrestrial biome schemes (compiled by Fischer et al. 2022) in one harmonised format, at a native 10 × 10 km resolution, together with functions to classify occurrence records into biome classes and to choose the most suitable scheme for a dataset in a transparent, reproducible way.
Because the layers are global at 10 × 10 km, biomes is built for macroecological and large-scale biogeographical questions (continental to global). It is not intended for fine-grained, national-extent analyses, where the 10 × 10 km grid is coarse.
The workflow follows four steps (see the four vignettes below):
A single wrapper, biomes_full(), runs all four steps in
one call.
scheme
argument. Numbers follow the order of the biome inventory (Fischer et
al. 2022).# install.packages("devtools")
devtools::install_github("azizka/biomes")biomes depends on terra and installs
ggplot2, sf, viridis
and tidyterra automatically. The combined figure
(cowplot) and the GBIF download path (rgbif,
CoordinateCleaner) live in Suggests and can be
installed on demand.
biomes_full() runs the whole four-step workflow. Give it
an occurrence dataset (or a taxon name); it chooses the best-fitting
biome scheme, classifies the records, tabulates them, and (optionally)
builds a figure. No figure is drawn by default
(plot = "none", the fastest option).
plot = "all" returns the combined figure in
res$plot, while a subset of
c("rank", "map", "barplot") returns the panels
individually (no panel letters) in
res$rank, res$map and
res$barplot.
library(biomes)
data(biomes_example)
# from an occurrence dataset:
res <- biomes_full(x = biomes_example) # scheme = "best"; no figure by default
res # short summary
res$scheme # the chosen biome scheme number
res$table # occurrence records per biome class
# add a figure with `plot`; the combined figure is returned in res$plot:
res <- biomes_full(x = biomes_example, plot = "all")
res$plot
ggplot2::ggsave("biomes_figure.png", res$plot, width = 9, height = 12, dpi = 300)
# the panels individually (no a/b/c letters) in res$rank / res$map / res$barplot:
res <- biomes_full(x = biomes_example, plot = c("rank", "map", "barplot"))
res$rank; res$map; res$barplot
# from a taxon name instead of a dataset (downloads from GBIF), e.g. a whole order:
res <- biomes_full(taxon = "Fagales", plot = "all")To force a specific scheme, pass its biome scheme number; to rank within one methodological group, pass a scheme type:
biomes_full(x = biomes_example, scheme = 1) # fixed scheme
biomes_full(x = biomes_example, scheme = "vegetation") # best vegetation schemeThe same pipeline as individual building blocks, following the four workflow steps:
# Step 1: Assembling occurrence records and biome schemes
data(biomes_example)
schemes <- biomes_get()
# Step 2: Choose a biome scheme
ranking <- biomes_rank(biomes_example, scheme_type = "vegetation")
best <- attr(ranking, "best_scheme")
# Step 3: Occurrences-to-biome classification
cls <- biomes_classify(biomes_example, scheme = best)
# Step 4: Output & visualisation
biomes_tab(cls)
biomes_visualise(biomes_example, scheme = best)biomes_visualise() draws up to three panels
(rank, map and barplot) combined
into one figure; select any subset with panels,
e.g. panels = "map".
Read them on the package website, or
open them locally with browseVignettes("biomes").
Please cite both:
citation("biomes")