learn r toolkit d kelly o'dayinstall setupmod 1 - setup: 1 module 1 installing setting up r...

16
D Kelly O'Day Install & Setup Mod 1 - Setup: 1 Learn R Toolkit Module 1 Installing & Setting Up R Do See & Hear Read Learn PowerPoint must be in View Show Mode to See videos and hyperlinks

Upload: dora-leonard

Post on 18-Jan-2018

217 views

Category:

Documents


0 download

DESCRIPTION

Learn R Toolkit D Kelly O'DayInstall & SetupMod 1 - Setup: 3 Installing R Latest version of R available at CRAN website:

TRANSCRIPT

Page 1: Learn R Toolkit D Kelly O'DayInstall  SetupMod 1 - Setup: 1 Module 1 Installing  Setting Up R Do See  HearRead Learn PowerPoint must be in View Show

D Kelly O'Day Install & Setup Mod 1 - Setup: 1

Learn R Toolkit

Module 1Installing & Setting Up R

Do

See & Hear Read

Learn

PowerPoint must be in View Show Mode to See videos and hyperlinks

Page 2: Learn R Toolkit D Kelly O'DayInstall  SetupMod 1 - Setup: 1 Module 1 Installing  Setting Up R Do See  HearRead Learn PowerPoint must be in View Show

D Kelly O'Day Install & Setup Mod 1 - Setup: 2

Learn R Toolkit

Module 1 Setting Up RWhat We’ll Cover

• Installing R • Working Directory• Set R Shortcut to point to Working Directory• Using R

– Working with R Console– Running Simple R Script

• Getting Help• R packages

Page 3: Learn R Toolkit D Kelly O'DayInstall  SetupMod 1 - Setup: 1 Module 1 Installing  Setting Up R Do See  HearRead Learn PowerPoint must be in View Show

D Kelly O'Day Install & Setup Mod 1 - Setup: 3

Learn R Toolkit

Installing R

• Latest version of R available at CRAN website:

http://www.r-project.org/

Page 4: Learn R Toolkit D Kelly O'DayInstall  SetupMod 1 - Setup: 1 Module 1 Installing  Setting Up R Do See  HearRead Learn PowerPoint must be in View Show

D Kelly O'Day Install & Setup Mod 1 - Setup: 4

Learn R Toolkit

Installing R Click video box to see video on downloading & installing R

Page 5: Learn R Toolkit D Kelly O'DayInstall  SetupMod 1 - Setup: 1 Module 1 Installing  Setting Up R Do See  HearRead Learn PowerPoint must be in View Show

D Kelly O'Day Install & Setup Mod 1 - Setup: 5

Learn R Toolkit

Installing R

• Latest version of R available at CRAN website:

http://www.r-project.org/

• Video Demonstration - Downloading & Installing R

• Your Turn– Go to CRAN Site (http://www.r-project.org)– Select Mirror Site– Download Base

• When R is installed continue slides

Page 6: Learn R Toolkit D Kelly O'DayInstall  SetupMod 1 - Setup: 1 Module 1 Installing  Setting Up R Do See  HearRead Learn PowerPoint must be in View Show

D Kelly O'Day Install & Setup Mod 1 - Setup: 6

Learn R Toolkit

Working Directory & Shortcut VideoClick video box to see video on Working Directory & R Shortcut

Page 7: Learn R Toolkit D Kelly O'DayInstall  SetupMod 1 - Setup: 1 Module 1 Installing  Setting Up R Do See  HearRead Learn PowerPoint must be in View Show

D Kelly O'Day Install & Setup Mod 1 - Setup: 7

Learn R Toolkit

Working Directory• RGUI.exe is installed in C:\Program

Files\R\R-2.8.1\bin

• R Uses C:\Program Files\R\R-2.8.1\bin as default directory for all R script files

• Create Your Own Working Directory to save your R scripts

– Go to Windows Explorer– Create a new folder

• Pick a name you will remember

• Let’s use (C:\Learn_R) • Once you have your new

work folder, copy path from address window)

Page 8: Learn R Toolkit D Kelly O'DayInstall  SetupMod 1 - Setup: 1 Module 1 Installing  Setting Up R Do See  HearRead Learn PowerPoint must be in View Show

D Kelly O'Day Install & Setup Mod 1 - Setup: 8

Learn R Toolkit

R Shortcut on Desktop• R Shortcut loads RGUI.exe program and

uses Start in directory for location of all R scripts

• To Configure Desktop R Shortcut to use your Working Directory for Start in: Right click Shortcut, select Properties

• Specify Start in path so that R looks in Working Directory you previously created (previous slide) for R Script Files– Paste you’re C:\Learn_R

• Now, when you use R shortcut to start R, your C:\Learn_R ory will be where you want it

Page 9: Learn R Toolkit D Kelly O'DayInstall  SetupMod 1 - Setup: 1 Module 1 Installing  Setting Up R Do See  HearRead Learn PowerPoint must be in View Show

D Kelly O'Day Install & Setup Mod 1 - Setup: 9

Learn R Toolkit

R Windows

R’s Working Windows1. R Console2. Script Editor3. Graphic Window – shows graphic

results

• User Work is done in Editor• R Console Communicates with R• R Console & Graphics window show results

Video on next slide shows an R session

Page 10: Learn R Toolkit D Kelly O'DayInstall  SetupMod 1 - Setup: 1 Module 1 Installing  Setting Up R Do See  HearRead Learn PowerPoint must be in View Show

D Kelly O'Day Install & Setup Mod 1 - Setup: 10

Learn R Toolkit

Using RClick video box to see video on Using R

Page 11: Learn R Toolkit D Kelly O'DayInstall  SetupMod 1 - Setup: 1 Module 1 Installing  Setting Up R Do See  HearRead Learn PowerPoint must be in View Show

D Kelly O'Day Install & Setup Mod 1 - Setup: 11

Learn R Toolkit

Your Turn to Work With R

• It’s Time for you to try R

• Your Assignment– Run R (Go to Desktop, double click your R shortcut)

– R Console• Try basic arithmetic in R Console• Try the Up arrow to recall previous commands• Clear R Console (right click in window, select Clear)

– Run R Script• Open Script (Scr_1_1_Simple_Chart_script.R)

• Run script (Control-A; Control-R)• Try to change color to “blue”

Scr_1_1_Simple_chart_script.r

Page 12: Learn R Toolkit D Kelly O'DayInstall  SetupMod 1 - Setup: 1 Module 1 Installing  Setting Up R Do See  HearRead Learn PowerPoint must be in View Show

D Kelly O'Day Install & Setup Mod 1 - Setup: 12

Learn R Toolkit

Getting Help

• R Console– help()– ?

• On Line Help: R Seek website (http://rseek.org)

• R Documentation & Tutorials– CRAN documentation (http://www.r-project.org/ select manuals)

Video on next slide shows how to get help in R and on-line

Page 13: Learn R Toolkit D Kelly O'DayInstall  SetupMod 1 - Setup: 1 Module 1 Installing  Setting Up R Do See  HearRead Learn PowerPoint must be in View Show

D Kelly O'Day Install & Setup Mod 1 - Setup: 13

Learn R Toolkit

Getting HelpClick video box to see video on R Help Resources

Page 14: Learn R Toolkit D Kelly O'DayInstall  SetupMod 1 - Setup: 1 Module 1 Installing  Setting Up R Do See  HearRead Learn PowerPoint must be in View Show

D Kelly O'Day Install & Setup Mod 1 - Setup: 14

Learn R Toolkit

R Packages

• What are R Packages

• Installing R Packages on Your System

• Getting Information on R Packages

Video on next slide shows how to install & find out about packages

Page 15: Learn R Toolkit D Kelly O'DayInstall  SetupMod 1 - Setup: 1 Module 1 Installing  Setting Up R Do See  HearRead Learn PowerPoint must be in View Show

D Kelly O'Day Install & Setup Mod 1 - Setup: 15

Learn R Toolkit

R packagesClick video box to see video on R Packages

Page 16: Learn R Toolkit D Kelly O'DayInstall  SetupMod 1 - Setup: 1 Module 1 Installing  Setting Up R Do See  HearRead Learn PowerPoint must be in View Show

D Kelly O'Day Install & Setup Mod 1 - Setup: 16

Learn R Toolkit

Module 1 Wrap up

• Congratulations – you are well on your way to Learning R• So far you have:

– Installed R– Set up your working directory– Configured your R shortcut to Start in your working directory– Learned about the R Console window– Learned about the R Script Editor Window– Learned about the R Graphics Window– Ran an R script– Learned about R help– Learned about R packages

• When you are ready, go to Module 2: Moving Between Excel and R Worlds

Remember: you can replay the videos at any time