knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" ) options(tibble.print_min = 5, tibble.print_max = 5)
demoR is a set of tools for formatting R code for presentations, teaching demonstrations, and much more:
The demo_*() functions prepare your source code to be both evaluated and displayed by knitr::knit().
The hlt_*() functions add text display formatting to printed code.
These combine naturally within code chunks in R Markdown files via code chunk options. You can learn more about them in vignette("demoR").
Currently, only the development version of demoR is available. You can install this by running
# install.packages("devtools") devtools::install_github("kbodwin/demoR")
library(demoR) data(iris) codestring <- "mean(iris$Sepal.Length, na.rm = TRUE)" hlt_funs(codestring) hlt_args(codestring) demo_code(codestring) %>% hlt_args()
If you encounter a clear bug, please file a minimal reproducible example on github.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.