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)
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.