The learnr package makes it easy to turn any R Markdown document into an interactive tutorial. Tutorials consist of content along with interactive components for checking and reinforcing understanding. Tutorials can include any or all of the following:
Narrative, figures, illustrations, and equations.
Code exercises (R code chunks that users can edit and execute directly).
Quiz questions.
Videos (supported services include YouTube and Vimeo).
Interactive Shiny components.
Tutorials automatically preserve work done within them, so if a user works on a few exercises or questions and returns to the tutorial later they can pick up right where they left off.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.