View source: R/dplot3_leaflet.R
dplot3_leaflet | R Documentation |
Plot interactive choropleth map using leaflet
dplot3_leaflet(
fips,
values,
names = NULL,
fillOpacity = 1,
palette = NULL,
color.mapping = c("Numeric", "Bin"),
col.lo = "#0290EE",
col.hi = "#FE4AA3",
col.na = "#303030",
col.highlight = "#FE8A4F",
col.interpolate = c("linear", "spline"),
col.bins = 21,
domain = NULL,
weight = 0.5,
color = "black",
alpha = 1,
bg.tile.provider = leaflet::providers$Stamen.TonerBackground,
bg.tile.alpha = 0.67,
fg.tile.provider = leaflet::providers$Stamen.TonerLabels,
legend.position = c("topright", "bottomright", "bottomleft", "topleft"),
legend.alpha = 0.8,
legend.title = NULL,
init.lng = -98.5418083333333,
init.lat = 39.2074138888889,
init.zoom = 3,
stroke = TRUE
)
fips |
Character vector of FIPS codes. (If numeric, it will be appropriately zero-padded) |
values |
Values to map to |
names |
Character vector: Optional county names to appear on hover
along |
fillOpacity |
Float: Opacity for fill colors. Default = 1 |
palette |
Character: Color palette to use |
color.mapping |
Character: "Numeric" or "Bin" |
col.lo |
Overlay color mapped to lowest value |
col.hi |
Overaly color mapped to highest value |
col.na |
Color mappes to NA values |
col.highlight |
Hover border color. Default = "#FE8A4F" (orange) |
col.interpolate |
Character: "linear" or "spline" |
col.bins |
Integer: Number of color bins to create if
|
domain |
Limits for mapping colors to values. Default = NULL and set to range |
weight |
Float: Weight of county border lines. Default = .5 |
color |
Color of county border lines. Default = "black" |
alpha |
Float: Overaly transparency. Default = 1 |
bg.tile.provider |
Background tile (below overlay colors), one of
|
bg.tile.alpha |
Float: Background tile transparency. Default = .67 |
fg.tile.provider |
Foreground tile (above overlay colors), one of
|
legend.position |
Character: One of: "topright", "bottomright", "bottomleft", "topleft". Default = "topright" |
legend.alpha |
Float: Legend box transparency. Default = .8 |
legend.title |
Character: Defaults to name of |
init.lng |
Float: Center map around this longitude (in decimal form). Default = -98.54180833333334 (US geographic center) |
init.lat |
Float: Center map around this latitude (in decimal form). Default = 39.207413888888894 (US geographic center) |
init.zoom |
Integer: Initial zoom level (depends on device, i.e. window, size). Default = 3 |
stroke |
Logical: If TRUE, draw polygon borders. Default = TRUE |
E.D. Gennatas
## Not run:
fips <- c(06075, 42101)
population <- c(874961, 1579000)
names <- c("SF", "Philly")
dplot3_leaflet(fips, supervals, names)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.