body_replace_gg_at_bkm {EpiReport} | R Documentation |
Replace a plot at a bookmark location
Description
Replace a plot at a bookmark location saving it as a PNG file in a temporary
folder.
A bookmark will be considered as valid if enclosing words within a paragraph;
i.e., a bookmark along two or more paragraphs is invalid,
a bookmark set on a whole paragraph is also invalid,
but bookmarking few words inside a paragraph is valid.
Usage
body_replace_gg_at_bkm(doc, gg, bookmark, width = 6, height = 3)
Arguments
doc |
a docx device |
gg |
a ggplot object or any object that can be printed in grDevices::png() |
bookmark |
bookmark id |
width |
the width of the device in inches |
height |
the height of the device. |
Value
doc
Examples
doc <- officer::read_docx(path = file.path(system.file(package = "EpiReport"),
"template/AER_template.docx" ))
p <- EpiReport::getTrend()
doc <- EpiReport::body_replace_gg_at_bkm(doc = doc,
gg = p,
bookmark = "TS_TREND",
width = 6,
height = 3)
[Package EpiReport version 1.0.2 Index]