drhur: Learn R with Dr. Hu Easily and Happily

Yue Hu and Yufei Sun


Learning a programming language such as R is tough. drhur is a pedagogical software make the R learners’ life a little bit easier and more happily. The package includes (and is going to include more) tutorials of basic and advanced data science skills with R, such as data cleaning, analyzing, and visualization. The goal of the package is to provide an interactive platform for learners to enter the R world easily and efficiently.

The package is built upon the learnr function which will open a shiny app for learners to interact with the instructions and tasks. The best way to learn these skills together with the “Learning R with Dr. Hu” online/offline workshops. One can get more information about the workshops through my website or contact me directly.


One can easily load the package and call the tutorials through the function drhur(). For instance, one can initiate the visualization tutorial with the following commands:

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


The current available tutorials include:

Function Description Usage
playing Playing around with R: Intro to basic data structure in R; inputting, outputting, and creating data. drhur('playing')
munging Data munging: Generalizing (such as sorting and summarizing) and extracting (selecting or adjusting certain columns or rows) data frames. drhur('munging')
analyzing Data analyzing: Analyze data with descriptive and multivariate tools and diagnoses. drhur('analyzing')
visualizing   Data presenting: Present descriptive and analytic results with ‘ggplot2’ drhur('visualizing')


drhur aims to help R learners to get in touch with the most common applied skills of the programming language. We encourage users to consult the help files for more details.

The development of the package is ongoing. Please contact us with any questions, bug reports, and comments. Free to open an issue on GitHub if you have any question or a feature request.


Yue Hu

Department of Political Science,

Tsinghua Univeristy


Website: https://sammo3182.github.io

Yuefei Sun

Department of Political Science,

Tsinghua University