Before our first section, please run make sure you have working and up-to-date installations of R and RStudio. We will make use both extensively in this course/section, so it is definitely worth doing right.

Installation

If you do not already have R and RStudio running on your computer, then you should install them both:

  1. Download R.
  2. Download RStudio. RStudio is a super helpful IDE (integrated development environment) for R. Very helpful for learning and using R.

If you already have R and RStudio on your computer, then you should make sure they are up to date. The current R version is 3.3.2 (a.k.a. Sincere Pumpkin Patch). You can check your version of R by typing version into the R console. The current version of RStudio is 1.0.136.

I would also recommend making sure you have a working installation of LaTeX (ShareLaTeX is another nice tool that also has a lot of LaTeX help/tutorials). Pandoc is also also helpful.

Does it work?

Open RStudio. Type 1 + 1 in the console. Do you get 2? If so, it looks like things are working.

Resources for R

I’ve compiled a pretty large set of resources for R. You probably don’t need them right now, but know they are there.

Basic suggestions

  1. Nearly everything you do should be in an R script, as opposed to the command line. You will want to return to your code at some point, an R script makes this possible (plus you have to turn in your R script with your assignments).
  2. Comment your code.
  3. Be consistent with your coding conventions (especially naming).
  4. Be smart when naming files, folders, etc..
  5. Make your life easier by organizing your files, directories, and using R’s paste0() (or paste()). See examples in Section 1.