Data Science for Social Impact

Intro to R

Raymond Wieser

RStudio

The RStudio Interface

  • The goal of this lab is to introduce you to R and RStudio,

  • which we’ll be using throughout the course both

    • to learn the statistical concepts discussed in the course
    • and to analyze real data and come to informed conclusions.
  • To clarify which is which:

    • R is the name of the programming language itself
    • and RStudio is an integrated development environment (IDE).

The RStudio Interface

As the labs progress,

  • you are encouraged to explore beyond what the labs dictate;
    • a willingness to experiment will make you a much better programmer.

Before we get to that stage, however,

  • you need to build some basic fluency in R.

The RStudio Interface

Today we begin with the fundamental building blocks of R and RStudio:

  • the interface,
  • reading in data,
  • and basic commands.

The Rstudio Interface Cont.

Go ahead and launch RStudio.

You should see a window that looks like the image shown below.

RStudio Panels

The panel on the lower left is where the action happens.

  • It’s called the console
    • On startup it will display information about the version of R you are running
    • We can directly type code into this panel
    • It can also be used as a calculator!