pts_leaflet: Occurrence points Leaflet map

Description Usage Arguments Value Examples

View source: R/pts_leaflet.R

Description

Create a Leaflet map with the presence or presence/absence locations. Good for spotting problematic points.

Usage

1
pts_leaflet(pts, cols = NULL, cluster = FALSE, popinfo = NULL)

Arguments

pts

A data frame containing the presence or presence/absence points. The first column should be longitude (x) and the sencond latitude (y). In the case of presence/absence data, an additional collumn should be provided, coded as 0 (absence) and 1 (presence).

cols

Character string indicating the color for the points or a character vector of length 2 indicating the colors for the presence and absence, respectively. If not supplied, the default will be used.

cluster

Should the points be clustered (i.e., aggregated)? Only valid if 'pts' is supplied. Default is FALSE.

popinfo

An optional vector of values to be used in the popup box when clicking in a point. Can be either a number indicating the column of the data.frame (this may be useful for e.g. showing value for a certain variable) or a character vector of length = number of points. If not supplied, the number of the row will be used (this may be useful for spotting points with problems).

Value

A Leaflet map with the points.

Examples

1
2
3
4
5
library(sdmvis)
# Load data
data("pa_data")
# Plot
pts_leaflet(pts = pa_data)

silasprincipe/sdmvis documentation built on Dec. 23, 2021, 2:22 a.m.