Learn R Programming

simplevis (version 1.5.0)

leaflet_stars: Map of an array in leaflet.

Description

Map of an array in leaflet.

Usage

leaflet_stars(data, pal = NULL, opacity = 0.5, title = "[Title]",
  legend_digits = 1, legend_labels = "[Array]", basemap = "light",
  shiny = FALSE, map_id = "map")

Arguments

data

A stars object with dimensions x and y with crs in wgs84 (epsg4326). Required input.

pal

Character vector of hex codes, or provided objects with pal_ prefixes.

opacity

Sets the opacity of the grid cells. Defaults to 0.1.

title

A title string that will be wrapped into the legend. Defaults to "Title".

legend_digits

Select the appropriate number of decimal places for numeric variable auto legend labels. Defaults to 1.

legend_labels

A vector of legend label values. Defaults to "[Array]".

basemap

The underlying basemap. Either "light", "dark", "satellite", "street", or "ocean". Defaults to "light". Only applicable where shiny equals FALSE.

shiny

TRUE or FALSE for whether the map is being run within a shiny app. Defaults to FALSE.

map_id

This argument is only relevant for within apps. For single map shiny apps, the id "map" can be used. For dual map apps, "map1" and "map2" should be used. Defaults to "map".

Value

A leaflet object.

Examples

Run this code
# NOT RUN {
leaflet_stars(example_stars_nz_no3n)
# }

Run the code above in your browser using DataLab