View source: R/ph_with_chart.R
ph_with.ms_chart | R Documentation |
produces a Microsoft Chart graphics output from R instructions
and add the result in a PowerPoint document object produced
by read_pptx()
.
## S3 method for class 'ms_chart' ph_with(x, value, location, ...)
x |
a pptx device |
value |
chart object |
location |
a location for a placeholder. |
... |
Arguments to be passed to methods. |
my_barchart <- ms_barchart(data = browser_data, x = "browser", y = "value", group = "serie") my_barchart <- chart_settings( x = my_barchart, dir="vertical", grouping="clustered", gap_width = 50 ) my_barchart <- chart_ax_x( x= my_barchart, cross_between = 'between', major_tick_mark="out") my_barchart <- chart_ax_y( x= my_barchart, cross_between = "midCat", major_tick_mark="in") library(officer) doc <- read_pptx() doc <- add_slide(doc, "Title and Content", "Office Theme") doc <- ph_with(doc, my_barchart, location = ph_location_fullsize()) fileout <- tempfile(fileext = ".pptx") print(doc, target = fileout)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.