Description Usage Arguments Examples
Add a legend to the map.
| 1 | add_legend(p)
 | 
| p | a datamaps object | 
| 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()
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.