Skip to contents

Add encodings to a spec. This is one way to add encodings... each encoding can also be added using vl_encode_<name> where <name> is the name of the encoding.

Usage

vl_encode(spec, ...)

Arguments

spec

a vegalite spec

...

encodings to add. Each encoding should be a list. See example.

Value

a modified vegalite spec

Examples


vl_chart() %>%
  vl_add_data(values = mtcars) %>%
  vl_mark_point() %>%
  vl_encode(
    x = "wt:Q",
    y = "mpg:Q"
  )