quickmd: Quick Markdown Report

Description Usage Arguments Value Examples

Description

Create a markdown report from a list of instructions.

Usage

1
2
3
quickmd(..., output_file = NULL, header = list(title = "mmmd report",
  author = Sys.getenv("USERNAME"), date = "`r Sys.Date()`", output =
  list(html_document = list(code_folding = "hide"))), open = TRUE)

Arguments

...

instructions, character will be converted to text and headers, formulas will be converted to chunks, optional lhs of formula is a list of chunk options.

output_file

path of output, optional

header

YAML header, given as a list fed to 'yaml::as.yaml'

open

if 'TRUE' (default), report will be opened after creation

Value

the path of the output file

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
library(tidyr)
x <- iris %>% nest(-Species)

# create report on the fly
quickmd(
  "# Plot of {x$Species[1]}",
  "{x$Species[1]} has a mean petal length of {mean(x$data[[1]]$Petal.Length)}",
  ~ hist(x$data[[1]]$Sepal.Width),
  .(fig.height=3) ~ hist(x$data[[1]]$Sepal.Length))

# create report from a list of instructions
dots <- list("# Plot of {x$Species[1]}",
             "{x$Species[1]} has a mean petal length of {mean(x$data[[1]]$Petal.Length)}",
             ~hist(x$data[[1]]$Sepal.Width),
             list(fig.height=3) ~ hist(x$data[[1]]$Sepal.Length))

quickmd(!!!dots)

moodymudskipper/mmmd documentation built on May 15, 2019, 9:14 p.m.