ECharts 4: powerful interactive visualisations in R.

Get Started Gallery Changelog Shiny demo

Installation

You can install echarts4r from any of the repositories below.

# install.packages("devtools")
devtools::install_github("JohnCoene/echarts4r") # github
devtools::install_bitbucket("JohnCoene/echarts4r") # bitbucket
devtools::install_git("https://git.coding.net/JohnCoene/echarts4r.git") # coding.net

Features

  • 33 chart types
  • Animations
  • Brush & sliders
  • WebGL support
  • Plugins included
  • Shiny proxies
  • themes
  • and more…

Examples

Some of what you can do with echarts4r, see the guide for more.

library(echarts4r)

# with negative
USArrests %>% 
  dplyr::mutate(
    State = row.names(.),
    Rape = -Rape
  ) %>% 
  e_charts(State) %>% 
  e_area(Murder) %>%
  e_bar(Rape, name = "Sick basterd", x.index = 1) %>% # second y axis 
  e_mark_line("Sick basterd", data = list(type = "average")) %>% 
  e_mark_point("Murder", data = list(type = "max")) %>% 
  e_tooltip(trigger = "axis")

# keras hsitory
history %>% 
  e_charts() %>% 
  e_keras_history()
  
# 3D bars
url <- paste0("https://ecomfe.github.io/echarts-examples/",
              "public/data-gl/asset/data/population.json")
data <- jsonlite::fromJSON(url)
data <- as.data.frame(data)
names(data) <- c("lon", "lat", "value")

data %>% 
  e_charts(lon) %>% 
  e_geo_3d() %>% 
  e_bar_3d(lat, value, coord.system = "geo3D") %>% 
  e_visual_map()