For those who prefer to learn from video, here are a sequence of
videos for getting started with litr
:
-
Quickstart Video. This video shows how little time
it takes to get started with
litr
.
-
A Full Literate Programming Example. This video
walks through the entire process of writing an R package with
litr
. Our example is an R package that fits least squares. We show how latex equations and plots can be used to explain code. We also show how to write a unit test (using thetestthat
R package).
-
Using Rcpp in an R Package. We show how to add
Rcpp
code to an R package usinglitr
. We continue the least squares example from our previous video. We useRcppArmadillo
and see that it makes our least squares function 3x faster.
-
Using
litr
withbookdown
. We show howlitr
can be used together withbookdown
to present your R package as an online book. This is particularly convenient for larger R packages where a single .html file.
-
Hosting your rendered
litr
document on Github. Once you have created alitr
document, you will want to make it easy for others to read it (without having to download anything locally themselves). We show how to do this with Github Pages for abookdown
document. The same process works for displaying a single .html file.