print.tidychart {tidycharts} | R Documentation |
Explicitly draw tidychart
Description
This function overrides default print method for tidycharts and prints them on the viewer pane in RStudio or as output in knitr.
Usage
## S3 method for class 'tidychart'
print(x, ...)
Arguments
x |
object of class tidychart to display |
... |
arguments passed to 'SVGrenderer' function |
Value
Invisibly returns the object of the tidychart class
Examples
# simply calling a plotting function will result in showing the chart
bar_chart(
data = data.frame(
cat = c('a', 'b', 'c'),
series = c(12,15,16)),
cat = 'cat',
series = 'series')
# result of the plotting function can also be assigned
barchart <- bar_chart(
data = data.frame(
cat = c('a', 'b', 'c'),
series = c(12,15,16)),
cat = 'cat',
series = 'series')
# and explicitly printed
print(barchart)
# or implicitly printed
barchart
[Package tidycharts version 0.1.3 Index]