Description Usage Arguments References Examples
Create and (optionally) visualize a Vega-Lite spec
1 2 3 4 |
description |
a single element character vector that provides a description of the plot/spec. |
renderer |
the renderer to use for the view. One of |
export |
if |
source |
if |
editor |
if |
viewport_width, viewport_height |
height and width of the overall
visualziation viewport. This is the overall area reserved for the
plot. You can leave these |
background |
plot background color. If |
time_format |
the default time format pattern for text and labels of
axes and legends (in the form of D3 time format pattern).
Default: |
number_format |
the default number format pattern for text and labels of
axes and legends (in the form of
D3 number format pattern).
Default: |
1 2 3 4 5 6 7 8 9 10 11 | dat <- jsonlite::fromJSON('[
{"a": "A","b": 28}, {"a": "B","b": 55}, {"a": "C","b": 43},
{"a": "D","b": 91}, {"a": "E","b": 81}, {"a": "F","b": 53},
{"a": "G","b": 19}, {"a": "H","b": 87}, {"a": "I","b": 52}
]')
vegalite() %>%
add_data(dat) %>%
encode_x("a", "ordinal") %>%
encode_y("b", "quantitative") %>%
mark_bar()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.