Skip to contents

Creates a plot of COSEWIC ranges for illustration and checking.

Usage

cosewic_plot(
  ranges,
  points = NULL,
  grid = NULL,
  map = NULL,
  species = "species_id",
  title = ""
)

Arguments

ranges

List. Output of cosewic_ranges() with spatial = TRUE.

points

Data frame. Optional naturecounts data used to compute ranges. Raw data points will be added to the plot if provided.

grid

sf data frame. Optional grid over which to summarize IAO values (useful for species with many points over a broad distribution).

map

sf data frame. Optional base map over which to plot the values.

species

Character. Name of the column containing species identification.

title

Character. Optional title to add to the map. Can be a named by species vector to supply different titles for different species.

Value

ggplot2 map

Examples

r <- cosewic_ranges(bcch)
cosewic_plot(r)

cosewic_plot(r, points = bcch)

cosewic_plot(r, grid = grid_canada(50), map = map_canada(), 
             title = "Black-capped chickadees")

             
m <- rbind(bcch, hofi)
r <- cosewic_ranges(m)
cosewic_plot(r)
#> $`14280`

#> 
#> $`20350`

#> 
cosewic_plot(r, points = m)
#> $`14280`

#> 
#> $`20350`

#> 
p <- cosewic_plot(r, grid = grid_canada(50), map = map_canada(), 
                 title = c("14280" = "Black-capped chickadees", 
                           "20350" = "House Finches"))
p[[1]]

p[[2]]