---
title: "drhur: Learn R with Dr. Hu Easily and Happily"
author: "Yue Hu and Yufei Sun"
output: rmarkdown::html_vignette
vignette: >
  %\VignetteIndexEntry{drhur: Learn R with Dr. Hu Easily and Happily}
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(
  message = FALSE,
  warning = FALSE
)

library(kableExtra)
```

## Overview

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.

## Usage

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:

```{r eval = FALSE}
if (!require(drhur)) install.packages("drhur")
library(drhur)

drhur("visualization")
```


The current available tutorials include：

```{r, results='asis', echo=FALSE}
txt <- data.frame(
  Function = 
    c('<a href="#playing">playing</a>',
      '<a href="#munging">munging</a>',
      '<a href="#analyzing">analyzing</a>',
      '<a href="#visualizing">visualizing</a>&nbsp;&nbsp;'),
  Description = 
    c('**Playing around with R:** Intro to basic data structure in R; inputting, outputting, and creating data.',
      paste('**Data munging: ** Generalizing (such as sorting and summarizing) and extracting (selecting or adjusting certain columns or rows) data frames.'),
      paste('**Data analyzing:** Analyze data with descriptive and multivariate tools and diagnoses.'),
      paste("**Data presenting:** Present descriptive and analytic results with 'ggplot2'")),
  Usage = 
    c("`drhur('playing')`",
      paste("`drhur('munging')`"),
      paste("`drhur('analyzing')`"),
      paste("`drhur('visualizing')`"))
  )

kable(txt, format = "html", escape = FALSE, align = c('l', 'l')) %>%
  kable_styling(full_width = FALSE, position = "left") %>%
  column_spec(1, bold = TRUE, monospace = TRUE, border_right = TRUE) %>%
  column_spec(2, width = "28em") %>%
  column_spec(3, width = "28em")
```

## Conclusion

`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](https://github.com/sammo3182/drhur/issues) if you have any question or a feature request.

## Affiliation

Yue Hu

Department of Political Science,

Tsinghua Univeristy

Email: <yuehu@tsinghua.edu.cn>

Website: <https://sammo3182.github.io>

<br></br>

Yuefei Sun

Department of Political Science,

Tsinghua University

Email: <sunyf20@mails.tsinghua.edu.cn>

