todocx: export figure to docx

View source: R/toffice.R

todocxR Documentation

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(s)

Kai Guo

Examples

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)
}

eoffice documentation built on Oct. 5, 2022, 9:05 a.m.