Learn R Programming

vegalite (version 0.6.1)

encode_size: Encode size "channel"

Description

Encode size "channel"

Usage

encode_size(vl, field = NULL, type, value = NULL, aggregate = NULL, sort = NULL)

Arguments

vl
Vega-Lite object created by vegalite
field
single element character vector naming the column. Can be * is using aggregate.
type
the encoded field’s type of measurement. This can be either a full type name (quantitative, temporal, ordinal, and nominal) or an initial character of the type name (Q, T, O, N). This property is case insensitive. If auto is used, the type will be guessed (so you may want to actually specify it if you want consistency).
value
scale value
aggregate
perform aggregaton on field. See Supported Aggregation Options for more info on valid operations. Leave NULL for no aggregation.
sort
either one of ascending, descending or (for ordinal scales) the result of a call to sort_def

References

Vega-Lite Encoding spec

Examples

Run this code
vegalite() %>%
  add_data("https://vega.github.io/vega-editor/app/data/cars.json") %>%
  encode_x("Horsepower", "quantitative") %>%
  encode_y("Miles_per_Gallon", "quantitative") %>%
  encode_size("Acceleration", "quantitative") %>%
  mark_point()

Run the code above in your browser using DataLab