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

Using R Studio Projects


Session 2

Artwork by @allison_horst

1 / 9

Working Directory

If you tell R/R Studio to look for a file, or save a plot, it will (by default) look in a place called the working directory (wd)



You can (usually) see your working directory path at the top of the console panel...


... it often defaults to the "Documents" folder.


This example is ~/workshop-r/ and ~ is in Documents

2 / 9

Browsing in RStudio

If you click the arrow next to the file pathway ~/workshop-r/


it will return you to the working directory and you can see all the files in that folder:


3 / 9

Organisation



Sooner or later (but probably sooner) you will wish to change where files are saved (and loaded from).


Being organised is key:


Reduces cognitive load (and frustration).

Artwork by @allison_horst

4 / 9

RStudio Projects


make it far easier for you to:


1) Organise files and workflow

2) Switch between projects

3) Share scripts / projects with others


(when collaborating or getting assistance)


Recommended for all tasks (large or small).

5 / 9

Create a project


File New Project New Directory New Project


Name the directory "workshop-r"

Create as a subdirectory somewhere useful for you

Create project!

6 / 9

RStudio Projects

Now your working directory is your project directory:



R will save and load files from here (by default).

If starting another project, repeat this process.

7 / 9

R Studio Projects

Switching between projects is simple


8 / 9

Acknowledgements

Artwork by @allison_horst

This work is licensed as


Creative Commons
Attribution
ShareAlike 4.0
International
To view a copy of this license, visit
https://creativecommons.org/licenses/by/4.0/

9 / 9

Working Directory

If you tell R/R Studio to look for a file, or save a plot, it will (by default) look in a place called the working directory (wd)



You can (usually) see your working directory path at the top of the console panel...


... it often defaults to the "Documents" folder.


This example is ~/workshop-r/ and ~ is in Documents

2 / 9
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