library(officer)
my_bar_stack_01 <- ms_barchart(data = browser_data, x = "browser",
y = "value", group = "serie")
my_bar_stack_01 <- as_bar_stack( my_bar_stack_01 )
my_bar_stack_02 <- ms_barchart(data = browser_data, x = "browser",
y = "value", group = "serie")
my_bar_stack_02 <- as_bar_stack( my_bar_stack_02, percent = TRUE,
dir = "horizontal" )
doc <- read_pptx()
doc <- add_slide(doc, layout = "Title and Content", master = "Office Theme")
doc <- ph_with(doc, my_bar_stack_02, location = ph_location_fullsize())
fileout <- tempfile(fileext = ".pptx")
print(doc, target = fileout)
Run the code above in your browser using DataLab