gg2v: Render a ggplot2 graphic with vega.

Description Usage Arguments Use

Description

Render a ggplot2 graphic with vega.

Usage

1
2
  gg2v(base_path = ".", plot = last_plot(), name = "test",
    ..., debug = TRUE)

Arguments

plot

ggplot2 graphic

base_path

path in which to save all visualisation files. Must already exist.

name

name of visualisation. Used to name html and js spec files

...

other arguments passed on to plot_spec

debug

if TRUE embeds spec in file and uses svg renderer, which makes the plot easier to debug

Use

This function creates all the files necesary to render a vega visualisation: but currently you're responsible for running a server to send them to the browser. You can't run directly from disk (with a file://) url, because browser security settings make it impossible to load data from relative urls.


hadley/gg2v documentation built on May 17, 2019, 10:15 a.m.