1

Using R: officer package (R3.6.3), with this set of code lines...trying to change font size in body of pptx slide. Et seq...

x = read_pptx()
x = add_slide(x, layout = "Title and Content", master = "Office Theme") %>% 
ph_with( block_list(fpar(ftext(reportTitleLine1, prop = fp_text(font.size = 43, color = "black")))),
      location = ph_location_type(type = "title") )

Ok up until here. Then,

ph_with(block_list(fpar(ftext(driveStatsStr, prop = fp_text(font.size = 14, color = "black")))),
    location = ph_location_type(type = "body") )

Produces error message:

Error in ph_with(block_list(fpar(ftext(driveStatsStr, prop = fp_text(font.size = 14,  : 
argument "value" is missing, with no default

driveStatDir contains:

driveStatsStr   = c(totalFileCountStr, totalFileVolumeStr, currentDriveStorage, currentDriveTotalStorage, currentDriveRemainStorageStr, estRemainingBackupsStr)

where,

[1] "Total file count: 93,029 files"                    "Total file volume:  98 GB"                        
[3] "Current Drive C storage: 2.74 TB"                  "Drive C total capacity: 7.27 TB"                  
[5] "Remaining Drive C capacity: 4.53 TB"               "Estimated remaining back-ups to full-capacity: 46"

What am I doing wrong with setting the font size of the content of the body in the pptx slide?

Au secours.

Benjamin Levy
  • 333
  • 6
  • 19
  • Did you forget the ```%>%``` after your previous line? – Sven Apr 28 '20 at 15:03
  • Hello, Sven. Thank you. Did you mean for me to terminate ph_with(block_list(fpar(ftext(driveStatsStr, prop = fp_text(font.size = 14, color = "black")))), location = ph_location_type(type = "body") ) with %>% ? – Benjamin Levy Apr 29 '20 at 14:19
  • Well, ```ph_with``` expects an rpptx object (x). In your title section you are fulfilling that need with the ```%>%```, that's why you don't need to add x in there. If you then don't end your line with %>% and try to put the one for the body, you will get this error. So either add x to your line body line or end your previous line with the pipe. – Sven Apr 29 '20 at 15:33

0 Answers0