pbdb_map_occur: Plot a raster showing the number of fossil occurrences

View source: R/pbdb_geographic_functions.R

pbdb_map_occurR Documentation

Plot a raster showing the number of fossil occurrences

Description

Creates a SpatRaster object and a plot of the sampling effort (number of fossil records per cell).

Usage

pbdb_map_occur(
  data,
  res = 5,
  col_int = "white",
  col_ocean = "black",
  col_eff = c("light blue", "blue"),
  do_plot = TRUE,
  ...
)

Arguments

data

Input data frame. This data frame is the output of the pbdb_occurrences() function using the argument show = "coords". See also Details and Examples.

res

The resolution of the SpatRaster object (in decimal degrees). See terra::res().

col_int

The colour of the mainland.

col_ocean

The colour of the ocean.

col_eff

Two or more colours that are used to generate the colour gradient showing the number of occurrences per cell in the map.

do_plot

Logical. If TRUE, the function produces a plot in addition to returning a SpatRaster.

...

Other parameters. See par() and map()

Details

The argument show = "coords" in the pbdb_occurrences() function is required. We recommend the use of a cairo device (X11()) for better visualization of the maps. See Examples.

Value

A SpatRaster object with the sampling effort (number of fossil records per cell). This SpatRaster object has the resolution that was specified in the res argument. The default is res = 5. Users that wish to work with objects of this type should load package terra.

See Also

See pbdb_occurrences(), map(), par() and colors() help pages

Examples

## Not run: 
  data <- pbdb_occurrences(
    limit = "all", vocab = "pbdb", base_name = "Canis", show = "coords"
  )
  X11(width = 13, height = 7.8)
  pbdb_map_occur(data, res = 2)
  ## Get the raster object without plotting it
  pbdb_map_occur(data, res = 3, do_plot = FALSE)

## End(Not run)

ropensci/paleobioDB documentation built on March 5, 2024, 3:08 a.m.