# NOT RUN {
is_sunos <- tolower(Sys.info()[["sysname"]]) == "sunos"
options( "ReporteRs-fontsize" = 11 )
# plot example for docx -----
# }
# NOT RUN {
doc = docx( )
doc = addPlot( doc, fun = function() barplot( 1:6, col = 2:7),
vector.graphic = TRUE, width = 5, height = 7,
par.properties = parProperties(text.align = "center")
)
writeDoc( doc, file = "ex_plot.docx" )
# }
# NOT RUN {
# plot example for pptx -----
# }
# NOT RUN {
doc = pptx( )
doc = addSlide( doc, slide.layout = "Title and Content" )
doc = addPlot( doc, fun = function() barplot( 1:6, col = 2:7),
vector.graphic = TRUE, width = 5, height = 4 )
if( !is_sunos ){
doc = addPlot( doc,
fun = function() barplot( 1:6, col = 2:7),
vector.graphic = FALSE,
offx = 7, offy = 0,
width = 3, height = 2
)
}
writeDoc( doc, file = "ex_plot.pptx" )
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab