| orb_map | R Documentation |
Draws country polygons from the built-in world_map dataset, or from a data
frame of your own with long, lat and group columns. The projection is
set with orb_coord_map(); if none is given, an equirectangular projection
is used.
orb_map(
data = NULL,
values = NULL,
region_col = "region",
value_col = NULL,
fill = "#DEE2E6",
colour = "#FFFFFF",
width = 0.4,
alpha = 1,
palette = "viridis",
na_fill = "#E9ECEF",
ocean = NULL
)
data |
Optional polygon data frame with columns |
values |
Optional data frame giving one value per region, used to fill the polygons. |
region_col, value_col |
Column names in |
fill |
Fixed fill colour used when |
colour |
Border colour. |
width |
Border width in pixels. |
alpha |
Opacity between 0 and 1. |
palette |
Continuous palette used for the choropleth; see
|
na_fill |
Fill colour for regions with no value. |
ocean |
Optional colour for the sea drawn behind the land: a disc for the orthographic globe, the panel background otherwise. |
To build a choropleth, supply values: a data frame with a region column
and a value column, matched to map regions by name.
An object of class orb_layer.
orb_coord_map(), world_map
orb_worldmap()
vals <- data.frame(region = c("Brazil", "India", "France"), v = c(3, 9, 5))
orb(world_map) + orb_map(values = vals, region_col = "region",
value_col = "v") + orb_coord_map("robinson")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.