Includes:

  • 215 maps for echarts4r.
  • A dataset of the latitude and longitude of all cities on planet earth with greater than 1000 inhabitants

Installation

install.packages("remotes")
remotes::install_github('JohnCoene/echarts4r.maps')

Example

Use in echarts4r.

library(dplyr)
library(echarts4r)
library(echarts4r.maps)

data("cities")

cities %>% 
  filter(country == "US") %>% 
  mutate(val = runif(n(), 1, 3)) %>% 
  e_charts(lon) %>%
  em_map("USA") %>% 
  e_geo(map = "USA") %>% 
  e_scatter(lat, val, coord_system = "geo", scale = NULL, legend = FALSE) %>% 
  e_visual_map(min = 1, max = 3) %>% 
  e_title("US Cities", "Cities with over 1,000 inhabitants")