Learn R Programming

eoffice (version 0.2.2)

todocx: export figure to docx

Description

export figure to docx

Usage

todocx(
  figure = NULL,
  filename = NULL,
  title = "",
  width = 6,
  height = 6,
  append = FALSE,
  devsize = FALSE,
  units = "in"
)

Arguments

figure

plot figure function

filename

output filename

title

title for the figure

width

width of the output figure

height

height of the output figure

append

append or not

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)

Author

Kai Guo

Examples

Run this code
if(interactive()){
plot(mtcars$mpg, mtcars$disp)
todocx(filename = file.path(tempdir(), "mtcars.docx"))
## use ggplot2
ggplot(mtcars, aes(mpg, disp, color = factor(cyl))) + geom_point()
todocx(filename = file.path(tempdir(), "mtcars.docx"), height = 6, width = 4)
}

Run the code above in your browser using DataLab