Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

ph_with.ms_chart

add a MS Chart output into a PowerPoint object


Description

produces a Microsoft Chart graphics output from R instructions and add the result in a PowerPoint document object produced by read_pptx().

Usage

## S3 method for class 'ms_chart'
ph_with(x, value, location, ...)

Arguments

x

a pptx device

value

chart object

location

a location for a placeholder.

...

Arguments to be passed to methods.

Examples

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)

mschart

Chart Generation for 'Microsoft Word' and 'Microsoft PowerPoint' Documents

v0.3.0
MIT + file LICENSE
Authors
David Gohel [aut, cre], ArData [cph], YouGov [fnd], Rokas Klydzia [ctb] (custom labels), David Camposeco [ctb] (chart_data_smooth function), Dan Joplin [ctb] (fix scatter plot data structure)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.