An R wrapper for the G2.js visualisation library.



Gallery Get Started

# install.packages("remotes")
remotes::install_github("devOpifex/g2r")
Easy to use
An intuitive, familiar API, and easy to pick up API.
Crosstalk
Support for crosstalk selection and filtering.
Shiny
Integration with shiny events and proxies.
Rmd
Integration for dynamic charts in Rmarkdown.
g2(penguins, asp(flipper_length_mm, body_mass_g, color = species)) %>%  
  fig_point(
    asp(size = body_mass_g, shape = "circle"),
    fillOpacity = .5,
    stroke = 0
  ) %>%  
  fig_smooth() %>% 
  axis_title_x("Flipper Length (mm)") %>% 
  axis_title_y("Body Mass (gram)") 
Limitations
g2r currently does not work well with large datasets (performance drop), and some features are still under development, namely rmarkdown actions, shiny proxies, and maps. Theming is not currently rather unwieldy.