inspect_point_species {commecometrics}R Documentation

Inspect overlapping species at sampling points

Description

Creates an interactive map to verify species overlap at selected points.

Usage

inspect_point_species(
  traits_summary,
  point_ids = NULL,
  n_random = 10,
  lon_col = "Longitude",
  lat_col = "Latitude",
  ID_col = "ID",
  min_species_valid = 3,
  env_var = NULL
)

Arguments

traits_summary

A list output from summarize_traits_by_point(), containing summarized trait values (⁠$points⁠) and species overlaps (⁠$overlap⁠).

point_ids

Optional. A vector of specific point IDs to inspect. If NULL, selects n_random points at random.

n_random

Number of random points to inspect if point_ids not provided (default = 10).

lon_col

Name of the longitude column in points (default = "Longitude").

lat_col

Name of the latitude column in points (default = "Latitude").

ID_col

Name of the ID column in points (default = "ID").

min_species_valid

Minimum number of species with trait data to consider a point valid (default = 3).

env_var

Optional. Name of the environmental variable column in points to include in popup.

Value

An interactive leaflet map showing selected points with species list popups.

Examples


# Load sample data from the package
data("geoPoints", package = "commecometrics")
data("traits", package = "commecometrics")
data("spRanges", package = "commecometrics")

# Summarize traits at points
traitsByPoint <- summarize_traits_by_point(
  points_df = geoPoints,
  trait_df = traits,
  species_polygons = spRanges,
  trait_column = "RBL",
  species_name_col = "sci_name",
  continent = FALSE,
  parallel = FALSE
)

# Visualize a random sample of 10 points
inspect_point_species(
  traits_summary = traitsByPoint,
  n_random = 10,
  min_species_valid = 3
)


[Package commecometrics version 1.0.0 Index]