knitr::opts_chunk$set( collapse = TRUE, comment = "#>" ) library(reproducibleRchunks)
First, load the reproducibleRchunks
package in the first code chunk.
Once the package is loaded, the code chunk type reproducibleR
is now available.
Your first code chunk will probably look like this:
```r library(reproducibleRchunks) ```
Now, you can use reproducibleR chunks like you use normal R code chunks. For example, let us define some data and run a simple statistical model in the following code chunk:
```r x <- 1:6 y <- c(4, 8, 15, 16, 23, 42 ) model <- lm(y~x) ```
x <- 1:6 y <- c(4, 8, 15, 16, 23, 42 ) model <- lm(y~x)
The reproducibleRchunks package will store meta-data about all variables that are newly declared within a given chunk. Every time, the document is regenerated and metadata are present, reproducibleR will compare the original data and the regenerated data and will display information about whether they match or not.
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.