Iām new to creating learnr tutorials and even more to creating packages, but after reading tutorials on these two topics, I can now create simple packages and simple learnr tutorials. Now that I know a bit about both topics, I would like to deploy my interactive tutorials in a basic package, but there are not many resources available. Can you show me how to do this in the simplest possible way?
Asked
Active
Viewed 118 times
1 Answers
2
You'll need to:
- Create a package
- Use a tutorial inside that package
1. Create a package
Check the chapter 2 of R Packages by Hadley Wickham. You'll understand how to start one by using:
library(devtools)
create_package("path/to/package")
2. Use a tutorial inside that package
Once you started a package you'll need to create a tutorial inside the inst
directory of your package. use_tutorial()
does it for you. Be sure to be in the package project inside RStudio.
usethis::use_tutorial(name, title)
That's all. Be sure to check the learnr
documentation for more details. More steps in https://education.rstudio.com/blog/2020/09/delivering-learnr-tutorials-in-a-package/

Samuel Calderon
- 641
- 3
- 13
-
Your help was valuable, thank you. I created my first ready to use and share learnr tutorial. Do you know how to costumize the html/css of the tutorial? ā mokdur Mar 07 '21 at 10:16
-
Yeah. Check the section for External resources in the learnr documentation. Don't forget to accept the answer here ā Samuel Calderon Mar 07 '21 at 13:11
-
I have found an awsome tutorial done by **ALLISON HORST** here [link](https://allisonhorst.shinyapps.io/dplyr-learnr/) ā mokdur Mar 07 '21 at 19:09