Map of stars in leaflet that is coloured.
leaflet_stars_col(
data,
col_var,
pal = NULL,
pal_na = "#7F7F7F",
pal_rev = FALSE,
alpha = 1,
basemap = "light",
col_cuts = NULL,
col_label_digits = NULL,
col_labels = NULL,
col_method = NULL,
col_na_rm = FALSE,
col_pretty_n = 4,
col_right_closed = TRUE,
col_title = NULL,
map_id = "map"
)
A stars object. Required input.
Unquoted attribute to colour the features by. Required input.
Character vector of hex codes.
The hex code or name of the NA colour to be used.
Reverses the palette. Defaults to FALSE.
The opacity of features. Defaults to 1.
The underlying basemap. Either "light", "dark", "satellite", "street", or "ocean". Defaults to "light". Only applicable where shiny equals FALSE.
A vector of cuts to colour a numeric variable. If "bin" is selected, the first number in the vector should be either -Inf or 0, and the final number Inf. If "quantile" is selected, the first number in the vector should be 0 and the final number should be 1. Defaults to quartiles.
If numeric colour method, the number of digits to round the labels to.
A vector to modify colour scale labels.
The method of colouring features, either "bin", "quantile" or "category." If numeric, defaults to "bin".
TRUE or FALSE of whether to visualise col_var NA values. Defaults to FALSE.
For a numeric colour variable of "bin" col_method, the desired number of intervals on the colour scale, as calculated by the pretty algorithm. Defaults to 4.
For a numeric colour variable, TRUE or FALSE of whether bins or quantiles are to be cut right-closed. Defaults to TRUE.
A title string that will be wrapped into the legend.
The shiny map id for a leaflet map within a shiny app. For standard single-map apps, id "map" should be used. For dual-map apps, "map1" and "map2" should be used. Defaults to "map".
A leaflet object.
# NOT RUN {
library(simplevis)
library(stars)
leaflet_stars_col(example_stars,
col_var = nitrate)
# }
Run the code above in your browser using DataLab