toffice | R Documentation |
export graph to MS office
toffice( figure = NULL, format = "pptx", filename = "temp.pptx", nr = 1, nc = 1, irow = 1, icol = 1, onsame = FALSE, title = "", left = 0.15, top = 0.15, append = FALSE, width = 4, height = 4, devsize = FALSE, units = "in" )
figure |
plot figure function |
format |
file format |
filename |
output filename |
nr, nc |
two numbers to indicate the figures will be drawn in an nr-by-nc array on the device by columns or rows, respectively. |
irow, icol |
two number to indicate which row or column for the figure to be drawn |
onsame |
Boolean value show to draw on same slide or not |
title |
title for the figure |
left, top |
two numbers which gives the number of lines of margin to be specified on the left and right sides of the plot |
append |
append or not |
width |
width of the output figure |
height |
height of the output figure |
devsize |
Boolean value show use device size or not (default = FALSE) |
units |
the units in which to return the value – inches, cm, or pixels (device units) |
Kai Guo
if(interactive()){ plot(mtcars$mpg, mtcars$disp) toffice(filename = file.path(tempdir(), "mtcars.pptx"), format = "pptx") ## use ggplot2 ggplot(mtcars, aes(mpg, disp, color = factor(cyl))) + geom_point() toffice(filename = file.path(tempdir(), "mtcars.pptx"),format = "pptx") }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.