Agenda

Time Topic
9:00 - 9:10 Intro & PollEverywhere
9:10 - 9:30 Introduction to R & Tidyverse
9:30 - 10:00 R Studio Intro (Hands-on)
10:00 - 10:30 Tidyverse/Tidyquant Example (Hands-on Code**)
10:30 - 11:00 Resources to Learn More

**You can also run the following line of code in R to get the Demo script:

url <- "https://webpages.uncc.edu/rwesslen/tidyquant-demo.R"
download.file(url, destfile = "tidyquant-demo.R")

Who am I?

I’m a PhD Candidate in Computing & Information Systems. My research is in Computational Social Science – where I focus on testing social science theories with data science tools like text analysis and social networks. However, my original background is Economics (undergrad and master’s) and Financial Mathematics (master’s). I also worked five years in credit risk management and a year in marketing analytics.

In the last two years, I taught R workshops for Project Mosaic and I built up R-related materials. Most of these materials focus on data science methods (e.g., data acquisition/handling, machine learning, text analysis, social network) but a lot would be relevant for any quantitative student.

My GitHub page

Instructions

Today’s workshop will be a blend of lecture/overview with a hands-on introduction to R Studio and a demo example. I’ll then end with a review of the resources below (because there’s a lot to learn in R!).

For the hands-on demos, ideally you will need R (download here) and R Studio (download here) installed on your computer.

Because university computers sometimes have admin rights that prevent downloading R, R Studio, or (more importantly) R-related packages, I strongly recommend using your own laptop if you want to try to run.

However, given we have such a limited amount of time, do not think that you must run the demos! If you get an error or warning message, don’t fret!

My goal today is not to teach you everything about R! My goal is to convince you that R is worth you investing time and energy as an analytical tool for your work, research, or even personal enjoyment!

Thus, if something doesn’t run, it’s okay. The resources below will help.

Resources

Help!

This page is your best source for R help: https://wesslen.github.io/fall2017-rworkshops/help.html

Task Views

To learn about what packages are available for specific topic or methodology, check out CRAN Views.

Econometrics & Finance

Tidyverse / Intro to R:

These resources are a best place to learn the basics. Traditionally, R was taught on the core (or “Base”) R packages. More recently, tidyverse has become the modern approach to learning R.

I highly recommend the first book for anyone wanting to learn R (and applying Data Science).

R Markdown / Shiny

Visualizations are critically important to any analysis. R includes helpful packages to enable advanced HTML visualizations (e.g., JavaScript, D3, VegaLite) with only knowing R!!

Shiny

Shiny is the most important tool that enables full visualization systems. These can be run “locally” (i.e., on your own computer but only you can access) or on a server to deploy on the internet (e.g., anyone can reach the site). Typically, most people do not have a server at their disposal so the fastest way to deploy a Shiny app is through R Studio’s Shinyapps.io free account.

R Markdown

R Markdown are examples of literate programming, i.e., code combined with plain language (as well as code output). The output can be an HTML, pdf, or even a Word document!

R Markdown can do nearly anything – build a website, write a LaTeX paper for publication, even write a book! (For example, http://r4ds.had.co.nz/ is written in R Markdown. See the GitHub.)

Flexdashboard: http://rmarkdown.rstudio.com/flexdashboard/

HTML Widgets (Javascript extensions in R): http://www.htmlwidgets.org/