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?
You'll need to:
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")
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/