knitr::opts_chunk$set(echo = TRUE, fig.width = 5, fig.height = 5)

The explainr package turns R objects into easily understood plain English. For example, suppose we have a proportion test:

pt <- prop.test(2, 10, .5)

We could turn it into plain English with:

library(explainr)
explain(pt)

In a knitr document, you might prefer to put results = 'asis'. For instance, in this next chunk, the output just looks like regular text:

explain(pt)

Visual theme

You can change what theme you use. For instance, the visual theme, instead of just providing text, also displays images:

m <- lm(mpg ~ wt + mpg, mtcars)

explain(m, "visual")


hilaryparker/explainr documentation built on May 17, 2019, 3:58 p.m.