Use this function to determine the library and version of a vegaspec.
vw_spec_version(spec)An object to be coerced to vegaspec, a Vega/Vega-Lite specification
list with elements library, version
Returns a list with two elements:
librarycharacter, either "vega" or "vega_lite"
versioncharacter, version tag
vw_spec_version(spec_mtcars)
#> $library
#> [1] "vega_lite"
#>
#> $version
#> [1] "5"
#>
# vw_to_vega() requires the V8 package
vw_spec_version(vw_to_vega(spec_mtcars))
#> $library
#> [1] "vega"
#>
#> $version
#> [1] "5"
#>