knitr::opts_chunk$set( warning = FALSE, collapse = TRUE, comment = "#>" ) library(dplyr) library(echarts4r) library(echarts4r.maps)
Includes:
install.packages("remotes") remotes::install_github('JohnCoene/echarts4r.maps')
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.