# NOT RUN {
cb <- "ls -a\nwhich -a ls"
options( "ReporteRs-fontsize" = 11 )
# }
# NOT RUN {
# docx example ---------
doc = docx( )
doc <- addCodeBlock( doc, text = cb )
writeDoc( doc, file = "ex_codeblock.docx" )
# }
# NOT RUN {
# }
# NOT RUN {
# pptx example ---------
doc = pptx( )
doc = addSlide( doc, slide.layout = "Title and Content" )
doc <- addCodeBlock( doc, text = cb )
writeDoc( doc, file = "ex_codeblock.pptx" )
# }
Run the code above in your browser using DataLab