What is a working directory in R?
The working directory is a folder on your computer that R has access to. This folder is where R loads in data, export results, and in general, works out of.
Lets say you make a new folder on your desktop named “example”. To access this folder, all we need is the file path.
Path to Working Directory
The path tells R how to find this folder. If the folder is on your desktop, it is very likely your path is something similar to “C:\Users\Dillon\Desktop\example” if you’re on Windows
YOUR PATH WILL BE DIFFERENT THAN MINE
Unless the username on your machine is also Dillon, it is likely your path will be different. If you are not tech savvy, it may be confusing to figure out what your path is the first time.
I’ve included a few resources that detail how to find the path for various devices.
Related Articles
How do I set the working directory in R?
Answered in Getting Started with R and RStudio: https://learnadv.com/courses/getting-started-with-r-and-rstudio/ To set the working directory, you'll need the file path. I’ve included a few resources the detail how to find the path for various ...
Do I have to download Rstudio to code in R?
Answered in Getting Started with R and Rstudio course at: https://learnadv.com/courses/getting-started-with-r-and-rstudio/lessons/section-0-introduction-to-r-2/topics/0-1-1-what-is-r-and-rstudio/ Technically speaking, you can run just the R ...
Where can I download R? Where can I download Rstudio?
Excerpt from the Getting Started with R and Rstudio free-course found here: https://learnadv.com/courses/getting-started-with-r-and-rstudio/lessons/section-0-introduction-to-r-2/topics/0-1-1-what-is-r-and-rstudio/ Installing R To install R you will ...
What are the common files used in R?
Answered in Getting Started in R and Rstudio course: https://learnadv.com/courses/getting-started-with-r-and-rstudio/ R scripts (.R files) In most uses of R, we create scripts. Scripts are a collection of code and functions written in the R language ...
Phi Statistic for Indicator Species
The Phi statistic is often used to represent Indicator Species. For example, the popular R package indicspecies relies heavily on reporting the Phi statistic from Chytrý et. al 2002 Indicator Species are those which signal some feature of the ...