The goal of reportutils is to provide utility functions that facilitate easier, faster and more reliable communication of data pre-processing and analysis.
You can install the development version of reportutils like so:
devtools::install_github("MiguelRodo/reportutils")
library(reportutils)
The function loop_and display
produces the following result, when
using the knitr
chunk option results = "asis"
:
example_tbl <- data.frame(
x = rep(c("Female", "Male"), each = 2),
y = rep(c("Child", "Adult"), 2),
path_plot = paste0(here::here(), "/man/fig/p_", 1:4, ".png"),
stringsAsFactors = FALSE
)
loop_and_display(
.tbl = example_tbl,
.vars = c("x", "y"),
.f = function(df) {
#print(df)
cat(paste0(""), "\n")
#knitr::include_graphics(df$path_plot)
}
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.