Working Directory
- What is a directory?
- A pointer, a map, a set of directions, A FILE SYSTEM
- How your computer knows where your files are in the hard drive/SSD,
in memory.
- What is a working directory?
- Where you are working right now.
- Points to the sub directory you are using.
- Prevents you from having to specify the whole path each time.
- How do you set your working directory?
- Use
setwd()
in console or at the begining of your R
file.
- Has this structure on MAC: /Users/williampoirier/Dropbox/etc
option + command + c
when on the folder you want in
Finder copies the directory to your clipboard.
- Has this structure on PC: C:
- This sucks because the
setwd()
function expects this
format: C:/Users/williampoirier/Dropbox/etc.
- A note on organisation
- REALLY IMPORTANT TO CREATE A STRUCTURE!
- t+10 years you is gonna be thankfull.
RStudio Projects
- Not necessary, but very helpfull when working on multiple
things.
- That’s because it:
- Sets a working directory.
- Remembers which files were openned when last closed.
- Saves your last environement (if you want it to).
- Let’s create a project!
- File > New Project > Existing Directory > where the
workshop folder is