# library(rJava) # library(ReporteRsjars) library(ReporteRs) cb <- "ls -a\nwhich -a ls" options( "ReporteRs-fontsize" = 11 ) # docx example --------- doc = docx( ) doc <- addCodeBlock( doc, text = cb ) writeDoc( doc, file = "ex_codeblock.docx" ) library(officer) read_pptx() # write a rdocx object in a docx file ---- if( require(magrittr) ){ read_pptx() %>% print(target = "out.pptx") # full path of produced file is returned print(.Last.value) } doc <- pptx() doc <- addSlide(doc, "Title and Content") writeDoc( doc, "ex_write_doc.pptx")