add_legend: Add legend

Description Usage Arguments Examples

View source: R/opts.R

Description

Add a legend to the map.

Usage

1

Arguments

p

a datamaps object

Examples

1
2
3
4
5
6
7
data <- data.frame(name = c("USA", "FRA", "CHN", "RUS", "COG", "DZA"),
    values = c("N. America", "EU", "Asia", "EU", "Africa", "Africa"))

data %>%
    datamaps() %>%
    add_choropleth(name, values, colors = c("skyblue", "yellow", "orangered")) %>%
    add_legend()

JohnCoene/datamaps documentation built on Aug. 30, 2020, 7:20 a.m.