I'm getting the following error when using the officer function ph_with_vg_at:
Error in dml_pptx(file = dml_file, width = width, height = height, offx = left, :
argument "height" is missing, with no default
I think the issue is the "funWorkaround" wrapper that I'm using in place of ph_with_vg_at. This function ensures that certain characters are encoded properly when writing to PPT (stole this function here). I don't get the error when I use ph_with_vg_at instead of funWorkaround.
This was all working perfectly until today, when I updated all of my packages. So not sure if this is an officer/rvg issue or maybe a piping issue. Or none of the above!
I'm looking to either resolve this error or find another way to preserve character encoding when writing from R to PPT. Thanks!
funWorkaround <- function(x, code, left, top, height, width, ...) {
# Re-Store old encoding on end
sOldEnc <- getOption("encoding")
on.exit(options(encoding=sOldEnc))
# Modify encoding
options(encoding="UTF-8")
# Create plot
return(ph_with_vg_at(x, code, left, top, height, width, ...))
}
ppt_test <- ppt_test %>%
add_slide(layout = "Two Content", master = "Office Theme") %>%
ph_with_text(type = "title", str = "Satisfaction with Issue Details") %>%
funWorkaround(code = print(issuedetails.plot),
left = 0.46,
top = 2,
width = 11.8,
height = 4.71)