Author: Sebastian Kranz, Ulm University
RTutor is an R package that allows to develop interactive R exercises. Problem sets can be solved off-line or can be hosted in the web with shinyapps.io. Problem sets can be designed as a Markdown .rmd file (to be solved directly in RStudio) or use a browser-based interface powered by RStudio’s Shiny. While the web interface looks nicer, I personally use problem sets in the Markdown format when teaching advanced economic classes.
RTutor and some required packages are not hosted on CRAN (while CRAN is great it takes a lot of time to maintain several packages there). I have created an own Github based R repository, from which you can install RTutor by using the following code:
Note: If you want to create your own web-based RTutor problem sets and upload them on shinyapps.io, you need to install RTutor and required packages directly from Github and CRAN as explained fruther below. That is because shinyapps.io only works with R packages directly installed from Github or CRAN.
Take a look at the manuals for documentation of how to create own problem sets. Also look at the examples below.
You can try out the Rmarkdown version of RTutor via RStudio Cloud:
For the web-based interface, several students at Ulm University have created very nice problem sets that allow to interactively replicate the main insights of interesting economic articles and to learn a bit about R and econometrics. Before developing your own problem sets, you may want to try out some of these examples:
If you a have course that uses RTutor that you want to share, just send me an email and I add your course to the list!
RTutor is used in a data science project course taught by Alex Rieber for business and economics students at Ulm University. The problem sets teach basic skills in R, including tidyverse data wrangling, as well as econometric and machine learning basic with economic applications. Alex published the problem sets and other course material here on Github. You find on the Github pages also links that allow you to test the problem sets on the rstudio cloud. The course is in German but Alex already started to make an English version of the problem sets, which will be added once finished.
Jade Benjamin-Chung from UC Berkeley School of Public Health has created with RTutor online tutorials for an introductory R course for epidemiologists. If you click on a tutorial the corresponding RTutor problem set can be directly solved on shinyapps.io. There is no need to log in.
I have published the RTutor problem sets and other material from my course in empirical industrial organization class in this Github repository. You can directly work on the problem sets here on rstudio.cloud. The course focuses a lot on estimating demand functions, but the R problem sets also cover other material, like data wrangling with dplyr.
To install RTutor and required packages directly from Github and CRAN, you can use the small function in the following gist:
Copy the code in the link into your R console and then run:
Depending on your devtools version, also the following code may work directly (yet source_gist is buggy in some devtools versions):
If you only want to update the RTutor package (and have the other packages already installed). You can just type:
(You may have to restart your R session / RStudio for the update to work.)
If you have suggestions or find bugs, please don’t hesitate to open an issue on the Github page.