Overview

This package allows us to add panning and zooming to any R graphics, e.g. base, ggplot2, lattice. To install t

install.packages("svgPanZoom")
install.packages("svglite") # Needed for base

To install the development version use

devtools::install_github("timelyportfolio/svgPanZoom")

Examples

Load the package in the usual way

library("svgPanZoom")
library("svglite")## For base

Then just wrap a base graphic function call

svgPanZoom(
  svglite:::inlineSVG(
    plot(1:10)
  ), controlIconsEnabled = TRUE
)

ggplot2 is just as easy

library("ggplot2")
data(mtcars, package = "datasets")
d = ggplot(mtcars, aes(mpg, disp, colour = disp)) + geom_jitter() +
  theme_bw()
svgPanZoom(d, controlIconsEnabled = TRUE)

Links



jr-packages/jrAutomate documentation built on Dec. 14, 2019, 6:35 p.m.