Skip to contents

Creates map visualizations of species ranges or species occurrences, providing customization options.

Usage

plot_species_map(
  x,
  species = NULL,
  title = "auto",
  auto_title = NULL,
  leg_label_default = NULL,
  suppress_legend = FALSE,
  xlims = NULL,
  ylims = NULL,
  trans = NULL,
  bcpower = NULL,
  breaks = NULL,
  labels = NULL,
  crop_to_grid = FALSE,
  single_plot = TRUE,
  panel_bg = NULL,
  land_fill_colour = NULL,
  legend_title = NULL,
  legend_limits = NULL,
  legend_title_wrap_length = 10,
  title_wrap_length = 60,
  spec_name_wrap_length = 40,
  visible_gridlines = TRUE,
  layers = NULL,
  scale = "medium"
)

Arguments

x

An 'indicator_map' object containing indicator values associated with map grid cells.

species

Species you want to map occurrences for. Can be either numerical taxonKeys or species names. Partial species names can be used (the function will try to match them).

title

Plot title. Replace "auto" with your own title if you want a custom title or if calling the function manually.

auto_title

Text for automatic title generation, provided by an appropriate S3 method (if calling the function manually, leave as NULL).

leg_label_default

Default label for the legend, provided by an appropriate S3 method (if calling the function manually, leave as NULL).

suppress_legend

Do not show legend. This should be set to true when plotting species ranges, as all cell values are 1.

xlims

(Optional) Custom x-axis limits.

ylims

(Optional) Custom y-axis limits.

trans

(Optional) Scale transformation for the fill gradient (e.g., 'log').

bcpower

(Optional) Power parameter for the Box-Cox, modulus, or Yeo-Johnson transformations.

breaks

(Optional) Break points for the legend scale.

labels

(Optional) Labels for legend scale break points.

crop_to_grid

If TRUE, the grid will determine the edges of the map.Overrides Europe_crop_EEA. Default is FALSE.

single_plot

By default all species occurrence time series will be combined into a single multi-panel plot. Set this to FALSE to plot each species separately.

panel_bg

(Optional) Background colour for the map panel.

land_fill_colour

(Optional) Colour for the land area outside of the grid (if surround = TRUE). Default is "grey85".

legend_title

(Optional) Title for the plot legend.

legend_limits

(Optional) Limits for the legend scale.

legend_title_wrap_length

Maximum legend title length before wrapping to a new line.

title_wrap_length

Maximum title length before wrapping to a new line.

spec_name_wrap_length

Maximum species name length before wrapping to a new line.

visible_gridlines

Show gridlines between cells. Default is TRUE.

layers

Additional rnaturalearth layers to plot, e.g. c("reefs", "playas").

scale

Scale of Natural Earth data ("small", "medium", or "large"). Default is 'medium'.

Value

A ggplot object representing the map of species range or occurrences. Can be customized using ggplot2 functions.

Examples

spec_occ_mammals_denmark <- spec_occ_map(example_cube_1,
                                    level = "country",
                                    region = "Denmark")
plot_species_map(x = spec_occ_mammals_denmark, c(2440728, 4265185))