Title: | Utility functions for RMarkdown |
---|---|
Description: | Helper functions to simplify writing of RMarkdown documents. Simplifies inclusion of graphics. |
Authors: | Gunther Krauss |
Maintainer: | Gunther Krauss <[email protected]> |
License: | GPL-3 |
Version: | 0.1.0 |
Built: | 2025-01-26 04:41:41 UTC |
Source: | https://github.com/gk-crop/rmdutil |
Graphs created in a loop or by some packages like Diagrammer are not always automatically included in the final document produced from a RMarkdown document. This function helps including graphics in documents.
## S3 method for class 'grViz' includeGraphic(gr, nr = 0) ## S3 method for class 'dgr_graph' includeGraphic(gr, nr = 0) includeGraphic(gr, nr = 0) ## Default S3 method: includeGraphic(gr, nr = 0)
## S3 method for class 'grViz' includeGraphic(gr, nr = 0) ## S3 method for class 'dgr_graph' includeGraphic(gr, nr = 0) includeGraphic(gr, nr = 0) ## Default S3 method: includeGraphic(gr, nr = 0)
gr |
graph |
nr |
optional number when creating more than one graph in a chunk |
Functions to:
Include graphs created by a loop into documents
Include DiagrammeR graphs in PDF
When producing graphics within a loop, only the last graph will be included by default. When calling this function, the graph is printed. If withBlanLine is TRUE, then a blank line is printed, causing the creation of figure environments.
showGraph(gr, withBlankLine = TRUE)
showGraph(gr, withBlankLine = TRUE)
gr |
graph |
withBlankLine |
if TRUE, then a blank line is printed |
Some environments like align
must not be
included within $$
..$$
when creating a PDF.
For Word documents, however, the $$
are needed.
texEnv()
texEnv()