+ - 0:00:00
Notes for current slide
Notes for next slide

Installing R and RStudio

Arvind Venkatadri

2022-08-09

1

Let's get started

Windows

  1. Download R for Windows here

  2. Run the .exe file that was downloaded in the step above.

  3. Go to the RStudio Download page

  4. Under All Installers select RStudio current version ## - Windows XP/Vista/7/8/10.

  5. Double click the file to install it.

  6. Once R and RStudio are installed, open RStudio to make sure that you don’t get any error messages.

2

Let's get started

Mac OS X

  1. Go to CRAN and click on Download R for (Mac) OS X.

  2. Select the **.pkg** file for the version of OS X that you have and the file will download. Double click on the file that was downloaded and R will install.

  3. Go to the RStudio Download page.

  4. Under All Installers select RStudio current version ## - Mac OS X 10.6+ (64-bit) to download it.

  5. Once it’s downloaded, double click the file to install it.

  6. Once R and RStudio are installed, open RStudio to make sure it works and you don’t get any error messages.

3

OK, what the Heck are R and RStudio?

  1. R is a free and open source language

R

  1. RStudio is a programming environment ( aka "IDE") that makes R coding easy.

RStudio

4

R ! Whatever is it good for?

5

Absolutely Anything !!

All depends upon your imagination.

6

Get to know RStudio

Click on this icon in your Applications folder: this icon

This will fire up your RStudio.

7

Get to know RStudio

This is RStudio, a integrated development environment ( IDE ) for R ( And Python, JS, SQL, D3 and a few other computer languages. )

8

Get to know RStudio

When you first open it, the RStudio interface is divided into four “Panes”:

9

Get to know RStudio

1.Top LEFT: the editor where you edit scripts and documents

10

Get to know RStudio

2.Top RIGHT: your environment/history panes. This is where you can see variables you’ve created and a full history of functions / commands you have run,

11

Get to know RStudio

3.Bottom RIGHT: The bottom right pane by default contains several panes including: files/plots/packages/help/viewer. We will explore these various panes together in class.

12

Get to know RStudio

4.Bottom LEFT: the R console is where the code is run. You can type code directly into the console OR you can send it to the console by running it from the editor.

13

Get to know RStudio

The placement of these panes and their content can be customized using the RStudio preferences:

  • (From the RStudio drop down choose: RStudio -> Preferences -> Pane Layout).
  • You can also drag the panes using your mouse to move / resize them.)

14

Where is your Work?

Create a working folder:📁 My_Documents/Irritating_R_Stuff

In RStudio: Click on: Tools -> Global Options

Click on Browse

Navigate to the default working folder: /My_Documents/Irritating_R_Stuff/

Apply and close.

15

Where is your Work?

  • On the Lab-00 page, click on the Lab button.
  • On that new page, click Download Rmd at the top right.
  • Save the .Rmd file in your Working Folder: /My_Documents/Irritating_R_Stuff/📁

In Your Files tab ( Pane 3 Bottom Right):

  • Click on the gear wheel ⚙️
  • Click on Go to Working Folder 📁
  • Your downloaded file .Rmd is now visible ✅
  • Click on the file
  • It should open in your Source Pane 1 at top left
  • ALWAYS create and save your files here!
  • Do not work with a file sitting in your My_Downloads folder 🛑 😠
16

Where is your Work?

  • This is an RMarkdown file ( file.ext = .Rmd)

  • It will enable you to run code and write text in the same document.

  • More in class!!

17

You R good to go!!

18

Let's get started

Windows

  1. Download R for Windows here

  2. Run the .exe file that was downloaded in the step above.

  3. Go to the RStudio Download page

  4. Under All Installers select RStudio current version ## - Windows XP/Vista/7/8/10.

  5. Double click the file to install it.

  6. Once R and RStudio are installed, open RStudio to make sure that you don’t get any error messages.

2
Paused

Help

Keyboard shortcuts

, , Pg Up, k Go to previous slide
, , Pg Dn, Space, j Go to next slide
Home Go to first slide
End Go to last slide
Number + Return Go to specific slide
b / m / f Toggle blackout / mirrored / fullscreen mode
c Clone slideshow
p Toggle presenter mode
t Restart the presentation timer
?, h Toggle this help
Esc Back to slideshow