Initiate your map with datamaps, pipe (%>%) your data to add data (add_data) or layers.

Your first map

Examples

data.frame(
  state = state.abb,
  area = state.area
) %>% 
  datamaps(scope = "usa", height = "400", width = "100%") %>%
  add_choropleth(state, area)

Combine types.

Set different projections and add graticule.

data <- data.frame(name = c("USA", "CAN", "BRA", "ARG", "MEX", "CUB", "BOL"),
                   color = round(runif(7, 1, 10)))

data %>%
  datamaps(projection = "orthographic", height = "400", width = "100%") %>%
  add_choropleth(name, color, colors = c("skyblue", "yellow", "orangered")) %>% 
  add_graticule() 

All of it (nearly).

Custom map

Plugins

SVG icons

Custom markers