Learn R Programming

rrtable (version 0.1.0)

add_img: Add plot into a document object

Description

Add plot into a document object

Usage

add_img(mydoc, plotstring, width = 7, height = 5, units = "in",
  res = 300, format = "emf", ...)

Arguments

mydoc

A document object

plotstring

An string of R code encoding plot

width

the width of the device.

height

the height of the device.

units

The units in which height and width are given. Can be px (pixels, the default), in (inches), cm or mm.

res

The nominal resolution in ppi which will be recorded in the bitmap file, if a positive integer. Also used for units other than the default, and to convert points to pixels.

format

plot format

...

additional arguments passed to png()

Value

a document object

Examples

Run this code
# NOT RUN {
require(officer)
require(rrtable)
require(magrittr)
require(flextable)
read_pptx() %>% add_text(title="Add image") %>% add_img("plot(mtcars)",format="png",res=300)
# }

Run the code above in your browser using DataLab