I've created a grid of qicharts2 plots using gridextra but when I try to send it to PowerPoint using officer I get this error..
Error in doc_parse_raw(x, encoding = encoding, base_url = base_url, as_html = as_html, : StartTag: invalid element name [68]
This is my code:
library(qicharts2)
library(gridExtra)
library(officer)
library(rvg)
#24 random numbers from a normal distribution for example.
y1 <- rnorm(24)
y2 <- rnorm(24)
yC1 <- qic(y1)
yC2 <- qic(y2)
grid <- grid.arrange(yC1,yC2)
filename <- "C:\\Desktop\\MyCharts.pptx"
read_pptx(filename) %>%
add_slide(layout = "Title and Content", master = "Office Theme") %>%
ph_with_vg(code = print(grid), type = "body") %>%
print(target = filename) %>%
invisible()
Huge thanks to everyone for your advice on how to improve my question so far.
Any help further help greatly received
GridTot
? – Punctilious