Overview

This very minimal post contains information on the following software programs:

  1. R – The programming language.
  2. R Studio – A fantastic interface for coding in R.
  3. LaTeX – Required to create PDF reports.
  4. R Commander – A true to form GUI (point and click) for using R. (Optional)

Program Installation

Windows

Double clicking on these will start the standard installation process.

Video walkthrough

Macintosh

Video walkthrough

Install via Homebrew. Guide courtesy of Justin Bankes (2017).

R Studio - A tour

Layout of R Studio - Initial Start

When you first (like very first time) open R studio you will see three panels.

Layout of R Studio - Console

The console is the full panel on the left

Layout of R Studio - Console

  • Everytime you launch RStudio, it will have the same text at the top of the console telling you the version of R that you’re running.
  • Below that information is the prompt, > . As its name suggests, this prompt is really a request, a request for a command.
  • Initially, interacting with R is all about typing commands and interpreting the output.
  • These commands and their syntax have evolved over decades (literally) and now provide what many users feel is a fairly natural way to access data and organize, describe, and invoke statistical computations.

Layout of R Studio - Console

The console is where you type commands and have them immediately performed.

Layout of R Studio - Environment

The panel in the upper right contains your workspace (aka Environment)

Layout of R Studio - Environment items

  • This shows you a list of objects/variables that R has saved.
  • For example here a value of 3 has been assigned to the object a.

Layout of R Studio - History

Up here there is an additional tab to see the history of the commands that you’ve previously entered.

Layout of R Studio - Files

The files tab allows you to open code/script files within R studio.

Layout of R Studio - Plots

Any plots that you generate will show up in the panel in the lower right corner.

Layout of R Studio - Getting Help

To check the syntax of any function in R, type ? in front of the function name to pull up the help file.

For example here I typed ?mean to get the help file for the mean function.

Layout of R Studio - Working file

Most often your R studio window will have 4 panels. The top left is where you write code or script, the console is now at the bottom.