encode_text {vegalite} | R Documentation |
Encode text "channel"
Description
Encode text "channel"
Usage
encode_text(vl, field, type, value = NULL, aggregate = NULL, sort = NULL)
Arguments
vl |
Vega-Lite object created by |
field |
single element character vector naming the column. Can be |
type |
the encoded field’s type of measurement. This can be either a full type
name ( |
value |
scale value |
aggregate |
perform aggregaton on |
sort |
either one of |
Note
right now, type
== "auto
" just assume "quantitative
". It
will eventually get smarter, but you are better off specifying it.
References
Examples
vegalite() %>%
cell_size(300, 200) %>%
add_data("https://vega.github.io/vega-editor/app/data/cars.json") %>%
encode_x("Horsepower", "quantitative") %>%
encode_y("Miles_per_Gallon", "quantitative") %>%
encode_color("Origin", "nominal") %>%
calculate("OriginInitial", "datum.Origin[0]") %>%
encode_text("OriginInitial", "nominal") %>%
mark_text()