add_legend: Add legend

Description Usage Arguments Examples

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()

datamaps documentation built on May 2, 2019, 1:09 p.m.