tutorial.helpers provides functions and RStudio Addins to help you write R tutorials, especially if you follow my advice about the best way to do so. This approach is currently used in several packages, including r4ds.tutorials and positron.tutorials.
InstallationTo install the package from CRAN:
install.packages("tutorial.helpers")
You can install the development version from GitHub with:
remotes::install_github("PPBDS/tutorial.helpers")
Download answers
The most useful tool is the download answers trick. In your tutorial, simply include library(tutorial.helpers)
in the setup R code chunk and then insert this empty code chunk at the end.
```{r download-answers, child = system.file("child_documents/download_answers.Rmd", package = "tutorial.helpers")}
```
This will ask the student to provide an estimate of how long the tutorial took to complete. It will then provide the ability to download the studentâs answers in html format. Students submit these files to their instructors, who can then confirm that the work was completed and look for any patterns in student (mis)understandings.
TestingThere are three exported functions for checking the tutorials in your package. See the testing vignette for details on their use.
Recommended componentsWe recommend including this child document at the start of each tutorial:
```{r info-section, child = system.file("child_documents/info_section.Rmd", package = "tutorial.helpers")}
```
This will insert (optional) questions asking for the studentâs name, email and id.
We also recommend including this at the beginning of your tutorial:
```{r copy-code-chunk, child = system.file("child_documents/copy_button.Rmd", package = "tutorial.helpers")}
```
This allows you to place a button in an exercise which will allow students to copy over all the code from the previous exercise. Use:
<button onclick = "transfer_code(this)">Copy previous code</button>
This is handy for students when a series of exercises requires them to build up a long pipe, line-by-line.
We recommend ending the tutorial with the download-answers child document, as discussed above.
```{r download-answers, child = system.file("child_documents/download_answers.Rmd", package = "tutorial.helpers")}
```
RStudio Addins
In order to access the RStudio addins, load the package. See the addins vignette for details about their use. Positron does not support addins, but the vignette explains how to use the same tools from the Console.
TutorialsThe package includes two tutorials: âTutorials in Positronâ and âTutorials in RStudio.â These provide an introduction to tutorials for beginning students. You should require your students to complete the tutorial associated with the IDE you are using if you are creating your own tutorials with tutorial.helpers package. For example, in Positron, have students run:
learnr::run_tutorial("positron", package = "tutorial.helpers")
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4