Translate ggplot2 object to vegaspec

# S3 method for gg
as_vegaspec(spec, single_view = FALSE, ...)

Arguments

spec

An object to be coerced to vegaspec, a Vega/Vega-Lite specification

single_view

boolean, indicates to collapse an unfaceted single-layer spec to a single-view spec

...

Other arguments (attempt to future-proof)

Value

An object with S3 class vegaspec

Details

To return a single-view spec, rather than a single-layer spec, use single_view = TRUE. Of course, this is effective only for ggplot objects that have exactly one layer.