This package has a series of example files that hightlight the capabilities of ggvega. As more capabilities are developed, more examples will be added.

gg_example_names()

gg_example(example = NULL)

Arguments

example

character, name of the example, NULL prints message containing names of all examples

Value

gg_example_names()

character, names of examples

gg_example()

S3 object with classes gg and ggplot; a ggplot2 object, identified by example

Examples

library("ggplot2") gg_example_names()
#> [1] "barchart-flipped-weighted-normalized-mpg" #> [2] "barchart-mpg" #> [3] "barchart-normalized-mpg" #> [4] "barchart-stacked-mpg" #> [5] "barchart-weighted-mpg" #> [6] "scat-coord-flip-iris" #> [7] "scat-scale-name-iris" #> [8] "scatterplot-iris"
gg_example_path("scatterplot-iris")
#> /home/travis/R/Library/ggvega/examples/ggplot/scatterplot-iris.R
gg_example("scatterplot-iris")
gg_example("scatterplot-iris") %>% as_vegaspec()