Intro to R
OIDD215: Analytics & the Digital Economy Juan Manubens January 29, 2018
Welcome!
This tutorial is designed to get you up and running with R as quickly as possible. If you have any questions, come to office hours, or ask questions on Slack. General Housekeeping First, we need to install ‘base R.’ Different download mediums are available on CRAN; pick the correct one for your computer. We strongly advise updating to the most up to date version of R. Base R comes with a passable ‘graphical user interface’ (GUI). Because R is an interpreted programming language, you can write R using any text editor. However, we strongly recommend using RStudio, an excellent interface for coding in R. Rstudio integrates the command line, graphical file directory explorer, graphical environment/variable inspector, and figure/plot output. It also has first-class support for RMarkdown, which comes in very handy for reports and PDF outputs. You can install Rstudio freely from their website - download the personal desktop version. If you ever want to check your current software version, go to the console and type sessionInfo() and hit enter. For non-beginners If you are familiar with R at more than a very superficial level (e.g. taken a previous class using R in the Statistics Department such as 470, 471, 405, 422, 431, etc) this tutorial is likely too simple. However, there is a lot to still learn. If you are interested in taking these classes or have questions about them, feel free to ask me via Slack or in person.
Step 0: Finger Warming
- It is strongly recommended that you go through Swirl, to work with R more before attempting any
assignment or lab. Even if you have used R before, it is required to update your R and Rstudio versions. Our versions are updated versions, so to ensure compatibility, you should also be runnning updated versions. Update R: Install a new R version, via CRAN. Change the path in your Rstudio options: Tools -> Options
- > General.
Update Rstudio: Help -> Check for Updates 1