• Stars
    star
    194
  • Rank 200,219 (Top 4 %)
  • Language
    R
  • Created over 11 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Creating interactive R Problem Sets. Automatic hints and solution checks. (Shiny or RStudio)

RTutor: Interactive R Problem Sets

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.

Installation

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). You can install it from my r-universe repository by using the following code:

options(repos = c(skranz = 'https://skranz.r-universe.dev',
    CRAN = 'https://cloud.r-project.org'))
install.packages("RTutor")

Create your own problem sets

Take a look at the manuals for documentation of how to create own problem sets. Also look at the examples below.

Trying out some problem sets

You can try out the Rmarkdown version of RTutor via RStudio Cloud:

https://rstudio.cloud/project/39040

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:

The Effect of Water Pollution on Cancer (by Brigitte Peter)

Political Incentives and Water Pollution in China (by Simon Maier)

Economic Impact of Covid-19 (by Alexandra Aehle)

What explains the employment drop in the great recession 2007-2009? (by Birgit Schroff)

Comparing the Environmental Damages of Driving Electric or Gasoline Cars (by Felix Stickel)

The causal effects of Sweden's CO2 Tax (by Theresa Graefe)

Public Procurement Auctions: Design, Outcomes and Adaption Costs (by Frederik Collin)

Poverty Reduction and Deforestation (by Katharina Kaufmann)

How soap operas reduced fertility in Brazil (by Clara Ulmer)

Excessive Traffic Jams? Improving Incentive Contracts for Road Construction Projects (by Claudius Schmid)

The impact of competition policy and industrial policy on economic development (by Julian Latzko)

Analyzing Mozart's letters: How emotions determine creativity (by Daniel Klinke)

Assessing Free Trade Agreements (by Tobias Fischer)

CO2 Trading and Risk of Firm Relocation (by Benjamin Lux)

Insurance and the Church (by Adidti Malani)

Public Infrastructure Spending and Voting Behaviour (by Philipp Klotz)

On the optimal taxation of top incomes (by Jonas Send)

The effect of the TseTse fly on African Development (by Vanessa SchΓΆller)

Pollution Reduction by Wind Energy (by Anna Sophie Barann)

Wall Street and the Housing Bubble (by Marius Wentz)

How much less effective are publicly assigned lawyers? (by Artemij Cadov)

Air pollution and house prices (by Moritz Sporer)

Female Role Models for Potential Economics Students (by Stefanie Buda)

Predicting Effects of Carbon Pricing on US Electricity Production (by Daniel Dreyer)

A macroeconomic study of credit booms and busts (by Thomas Clausing)

The impact of emmission trading on green innovation (by Arthur SchΓ€fer)

Social Spillovers in Movie Consumption (by Lara Santak)

Building Codes and Energy Efficiency (2 versions, by Simon Hertle and Lisa Eilts)

Gasoline Prices and Consumer Behavior (by Melina Klenk)

Technological Progress and Fuel Economy of Cars (by Marius Breitmayer)

Experiment zu sozialen Netzwerken und Vertragserfuellung (by Fabian Zeiher)

Long-Term Effects of Communism in Eastern Europe (by Benjamin Markert)

How can Scandinavians tax so much? (by David Hertle)

An interesting case study of a bank run (by Joachim Plath)

Courses that use RTutor problem sets

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!

  • Two courses from me: Empirical Economics with R and Market Analysis with Econometrics and Machine Learning. Both consists of online shiny apps with videos and quizzes and many RTutor problem sets.

  • 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.

  • RTutor is also used in a compulsory 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.

Installing RTutor directly from Github

To install RTutor and required packages directly from Github and CRAN, you can use the small function in the following gist:

https://gist.github.com/skranz/fad6062e5462c9d0efe4

Copy the code in the link into your R console and then run:

install.rtutor(update.github=TRUE)

Depending on your devtools version, also the following code may work directly (yet source_gist is buggy in some devtools versions):

if (!require(devtools)) 
  install.packages("devtools")

devtools::source_gist("gist.github.com/skranz/fad6062e5462c9d0efe4", filename="install_rtutor.r")
install.rtutor(update.github=TRUE)
library(RTutor)

If you only want to update the RTutor package (and have the other packages already installed). You can just type:

devtools::install_github("skranz/RTutor", upgrade="ask")

(You may have to restart your R session / RStudio for the update to work.)

Suggestions & Feedback

If you have suggestions or find bugs, please don't hesitate to open an issue on the Github page.

More Repositories

1

empecon

Empirical Economics with R
HTML
64
star
2

shinyEvents

Use shiny with event handlers instead of reactivity
R
36
star
3

MarketAnalysis

Market Analysis Course with Interactive RTutor Problemsets, Videos and Quizzes
HTML
35
star
4

dbmisc

Tools for working with databases in R
R
25
star
5

dplyrExtras

Some extra functionality that is not (yet) in dplyr, e.g. mutate_rows or s_filter, s_arrange ,...
R
20
star
6

xsynthdid

Simple function to adjust for covariates in synthdid
R
16
star
7

gtree

Game Theoretic Representation of Economic Experiments
R
15
star
8

restorepoint

Debugging in R with restore points
R
15
star
9

ReplaceInFiles

RStudio Addin to Find and Replace in Multiple Files
R
13
star
10

EconJournalData

Shiny App to Search for Economics Articles with Data Supplements
R
10
star
11

glueformula

String interpolation to build regression formulas
R
7
star
12

mygpt

Customizable ChatGPT Addins for RStudio
R
7
star
13

gpt4r

Tools for using ChatGPT from R and RStudio
R
7
star
14

Empirical_IO_Course

Material from my master level course "Empirical Industrial Organisation and Consumer Choice"
HTML
7
star
15

RMaxima

Interface between R and Maxima (an open source computer algebra system)
R
6
star
16

StratTourn

Tournament of game theoretic strategies
HTML
5
star
17

ParallelTrendsPlot

Draw plot to assess parallel trends assumption in DID regression with additional control variables
R
5
star
18

RTutorSAGI

RTutor Submissions Analysis for Grading and Improvement
R
5
star
19

shinyQuiz

Quiz widget for shiny events apps
R
5
star
20

xglue

Extended glue
R
4
star
21

RelationalContracts

Game theoretic analysis of dynamic games and relational contracts in R
HTML
4
star
22

facebook_ira_ad_quiz

Shiny Quiz about Russian IRA Facebooks Ads
R
3
star
23

eu_cars_co2

Aggregated data of newly registred EU cars used in my blog
R
2
star
24

CoursesWithR

HTML
2
star
25

shinyEventsPushMessage

Send push messages with a shinyEvents app
R
2
star
26

skranz.github.com

CSS
2
star
27

modify

modify is a function to augment dplyr for quick replacement by reference as in data.table
R
2
star
28

EconCurves

Tools for economic models based on curves
R
2
star
29

dataquiz

Different types of data based quizzes (shinyEvents)
R
2
star
30

phack

This R package implements the tests from Elliot et al. (2022) for detecting p-Hacking.
R
2
star
31

lassoEffectSim

Simulation study: causal effects estimation with lasso variants
R
2
star
32

gtreeWebPlay

Create shiny apps to play gtree games
R
2
star
33

dyngame

Solving discounted stochastic games with monetary transfers
R
2
star
34

repgame

Solve discounted repeated games with monetary transfers
R
2
star
35

dataquizDocker

Docker container for economics dataquiz
R
2
star
36

loginPart

A very simple login framework for shiny apps via email verification
R
1
star
37

testex

Test a package by running and comparing examples
R
1
star
38

LyxMaxima

An R based GUI for computer algebra with Lyx using Maxima
R
1
star
39

BLPsim

Some tools extending BLPestimatoR to facilitate merger simulation
R
1
star
40

BLPestimatoR

A fork of the CRAN package BLPEstimatoR
R
1
star
41

stringtools

stringtools
R
1
star
42

seat_calculator_bundestag

R code to compute seats in German Bundestag given 2020 election law
R
1
star
43

ffmpeg

Some R interface functions to ffmpeg to convert videos
R
1
star
44

skranz.r-universe.dev

Packages on my R universe (see https://r-universe.dev/)
1
star
45

GithubActions

Tools for working with Github and Github Actions
R
1
star
46

shinyChatQuiz

App for online lecture support with chat and quizzes
R
1
star
47

rskranzDocker

An intermediate docker image useful for several shiny app docker containers of mine
R
1
star
48

taddleapp

Taddle: Simply Allocate Seminar Topics
HTML
1
star
49

shinyEventsLogin

Login Module for ShinyEvents Apps
R
1
star
50

appForms

Tools to create and arrange input forms for shiny apps using simple yaml field specification
R
1
star
51

sktools

R tools for my courses
R
1
star
52

shinyDataMapping

Shiny based GUI to map columns and values to new data frame
R
1
star
53

stuko

Admin shiny app for course administration
R
1
star
54

RTutor2

Temporary Project: Rewrite internal structure of RTutor
R
1
star
55

RStudioStataConsole

RStudio addin that facilitates running Stata in RStudio's termial.
R
1
star
56

YamlObjects

Implement a simple Yaml based object system in R
R
1
star
57

jobr

Shiny app to manage administrative jobs where groups of people have to provide data or should perform tasks and reply when done.
R
1
star
58

bpdata

Transformed data of the BP Statistical Review of World Energy 2017
R
1
star
59

rmdtools

Tools for RMarkdown
R
1
star
60

webforms

Forms for shinyEvents apps
R
1
star
61

demandsim

Simulate differentiated product demand from various consumer types
R
1
star
62

shinyEventsUI

some shiny widgets (only work with a shinyEvents app)
JavaScript
1
star
63

translate.do

Translate simple do files commands to R
R
1
star
64

github_actions_test

R
1
star
65

jobDispatcher

Conveniently dispatch multiple jobs in RStudio
R
1
star