Skip to contents

This function creates an interactive map of occurrence records using mapview, visually highlighting flags. This tool helps users explore which records were flagged by one or more validation functions and inspect them directly on the map.

Usage

map_here(
  occ,
  species = NULL,
  long = "decimalLongitude",
  lat = "decimalLatitude",
  flags = "all",
  additional_flags = NULL,
  names_additional_flags = NULL,
  col_additional_flags = NULL,
  show_no_flagged = TRUE,
  cex = 6,
  lwd = 2,
  col_points = NULL,
  label = NULL,
  ...
)

Arguments

occ

(data.frame or data.table) a dataset containing occurrence records that has been processed by one or more flagging functions. See Details for available flag types.

species

(character) name of the species to subset and plot. Default is NULL, meaning that all records for all species are plotted.

long

(character) the name of the column in occ that contains the longitude values. Default is "decimalLongitude".

lat

(character) the name of the column in occ that contains the latitude values. Default is "decimalLatitude".

flags

(character) the flags to be used for coloring the records. Use "all" to display all available flags. See Details for all options. Default is "all".

additional_flags

(character) an optional named character vector with the names of additional logical columns to be used as flags. Default is NULL.

names_additional_flags

(character) an optional different name to the flag provided in additional_flags to be shown in the map. Only applicable if additional_flags is not NULL.

col_additional_flags

(character) if additional_flags is provided, the color of the records flagged in this column. Obligatory if additional_flags is not NULL.

show_no_flagged

(logical) whether to display records that did not receive any flag.Default is TRUE.

cex

(numeric) point size for plotting occurrences. Default is 6.

lwd

(numeric) line width for point borders. Default is 2.

col_points

(character) A named vector assigning colors to each flag. If NULL, default colors from the internal object RuHere::flag_colors() are used.

label

(character) column name in occ to use as the mouseover label. Default is NULL, in which case the record's row number is displayed.

...

additional arguments passed to mapview::mapview().

Value

An interactive mapview object displaying flagged and optionally unflagged occurrence records.

Details

The following flags are available: correct_country, correct_state, cultivated, fossil, inaturalist, faunabr, florabr, wcvp, iucn, duplicated, thin_geo, thin_env, .val, .equ, .zer, .cap, .cen, .sea, .urb, .otl, .gbf, .inst, and .aohi.

These flags are typically generated by functions in the RuHere or CoordinateCleanerworkflow to identify potential data-quality issues in occurrence records.

Users may also supply additional logical columns using additional_flags, optionally providing alternative display names (names_additional_flags) and colors (col_additional_flags).

Examples

# \donttest{
# Load example data
data("occ_flagged", package = "RuHere")
# Visualize flags interactively
map_here(occ = occ_flagged, label = "record_id")
# }