View source: R/geographicmap.R
GeographicMap | R Documentation |
Creates a map with a table as input, using shading to represent the values of countries or states on the map.
GeographicMap(
x,
country,
high.resolution = FALSE,
show.missing.regions = TRUE,
treat.NA.as.0 = FALSE,
colors = c("#CCF3FF", "#23B0DB"),
ocean.color = "#DDDDDD",
opacity = 1,
color.NA = "#808080",
global.font.family = "Arial",
global.font.color = "#2C2C2C",
legend.show = TRUE,
legend.title = "",
legend.font.family = global.font.family,
legend.font.color = global.font.color,
legend.font.size = 14,
values.hovertext.format = "",
values.bounds.minimum = NULL,
values.bounds.maximum = NULL,
mapping.package = "leaflet",
background = FALSE,
title = "",
title.font.family = global.font.family,
title.font.color = global.font.color,
title.font.size = 16,
subtitle = "",
subtitle.font.family = global.font.family,
subtitle.font.color = global.font.color,
subtitle.font.size = 12,
footer = "",
footer.font.family = global.font.family,
footer.font.color = global.font.color,
footer.font.size = 8,
footer.wrap = TRUE,
footer.wrap.nchar = 100,
hovertext.font.family = global.font.family,
hovertext.font.size = 11,
zip.country = "Automatic"
)
x |
A matrix, two-dimensional array, table or vector, containing the
data to be plotted. The |
country |
Character string optionally stating the country that the states are from, if
|
high.resolution |
Specifically request a high resolution map. Otherwise the resolution of the map is chosen automatically based on the resolution required for the requested countries or regions. |
show.missing.regions |
Logical; Whether to plot regions not included in
|
treat.NA.as.0 |
Plots any |
colors |
A vector of two colors, which are used as endpoints in interpolating colors. |
ocean.color |
The color used for oceans (or background). |
opacity |
Opacity of bars as an alpha value (0 to 1). |
color.NA |
The color used to represent missing values. Not used when
|
global.font.family |
Character; font family for all occurrences of any font attribute for the chart unless specified individually. |
global.font.color |
Global font color as a named color in character format (e.g. "black") or an rgb value (e.g. #' rgb(0, 0, 0, maxColorValue = 255)). |
legend.show |
Logical; Whether to display a legend with the color scale. |
legend.title |
The text to appear above the legend. |
legend.font.family |
Font family of legend. |
legend.font.color |
Font color of legend. Only used with |
legend.font.size |
Font size of legend. Changing the defaults for leaflet object can give strange spacing. |
values.hovertext.format |
A string representing a d3 formatting code. See https://github.com/d3/d3/blob/master/API.md#number-formats-d3-format |
values.bounds.minimum |
Numeric; specifies the minimum value in the colorscale. If not specified, this will be automatically determined from the data. If the value specified is larger than the minimum in the data then the specified value will be ignored. |
values.bounds.maximum |
Numeric; specifies the maximum value in the colorscale. |
mapping.package |
Either |
background |
If |
title |
Character; chart title. |
title.font.family |
Character; title font family. Can be "Arial Black", "Arial", "Comic Sans MS", "Courier New", "Georgia", "Impact", "Lucida Console", "Lucida Sans Unicode", "Marlett", "Symbol", "Tahoma", "Times New Roman", "Trebuchet MS", "Verdana", "Webdings" |
title.font.color |
Title font color as a named color in character format (e.g. "black") or a hex code. |
title.font.size |
Integer; Title font size; default = 10. |
subtitle |
Character |
subtitle.font.family |
Character; subtitle font family |
subtitle.font.color |
subtitle font color as a named color in character format (e.g. "black") or an a hex code. |
subtitle.font.size |
Integer; subtitle font size |
footer |
Character |
footer.font.family |
Character; footer font family |
footer.font.color |
footer font color as a named color in character format (e.g. "black") or an a hex code. |
footer.font.size |
Integer; footer font size |
footer.wrap |
Logical; whether the footer text should be wrapped. |
footer.wrap.nchar |
Number of characters (approximately) in each
line of the footer when |
hovertext.font.family |
Font family of hover text. |
hovertext.font.size |
Only used with |
zip.country |
One of |
an HTML widget for "leaflet"
or a "plotly"
object.
data <- seq(4)
names(data) <- c("France", "China", "Brazil", "Canada")
GeographicMap(data)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.