body_add_gg

0th

Percentile

add ggplot

add a ggplot as a png image into an rdocx object

Usage
body_add_gg(x, value, width = 6, height = 5, style = NULL, ...)
Arguments
x

an rdocx object

value

ggplot object

width

height in inches

height

height in inches

style

paragraph style

...

Arguments to be passed to png function.

Aliases
  • body_add_gg
Examples
# NOT RUN {
if( require("ggplot2") ){
  doc <- read_docx()

  gg_plot <- ggplot(data = iris ) +
    geom_point(mapping = aes(Sepal.Length, Petal.Length))

  if( capabilities(what = "png") )
    doc <- body_add_gg(doc, value = gg_plot, style = "centered" )

  print(doc, target = tempfile(fileext = ".docx") )
}
# }
Documentation reproduced from package officer, version 0.3.5, License: GPL-3

Community examples

Looks like there are no examples yet.