How To Set Working Directory | Introduction To Quantitative Methods
Maybe your like
- Introduction
- 1. Introduction to Quantitative Analysis
- 1.1. Seminar
- 1.2. Solutions
- 2. Descriptive Statistics
- 2.1. Seminar
- 2.2. Solutions
- 3. T-test for Difference in Means and Hypothesis Testing
- 3.1. Seminar
- 3.2. Solutions
- 4. Bivariate linear regression models
- 4.1. Seminar
- 4.2. Solutions
- 5. Multiple linear regression models
- 5.1. Seminar
- 5.2. Solutions
- 6. Assumptions and Violations of Assumptions
- 6.1. Seminar
- 6.2. Solutions
- 7. Interactions
- 7.1. Seminar
- 7.2. Solutions
- 8. Panel Data, Time-Series Cross-Section Models
- 8.1. Seminar
- 8.2. Solutions
- 9. Binary models: Logit
- 9.1. Seminar
- 9.2. Solutions
- 10. Frequently Asked Questions
- 10.1. R on UCL Computers
- 10.2. How to Set Working Directory
- 10.3. Operators in R
- 10.4. Order of Loading Packages
- 10.5. Installing Zelig
- 10.6. Interpreting Zelig Simulation
- 10.7. Common Problems and Solutions
- 10.8. Downloading WDI Dataset
- 11. Optional Material
- 11.1. Central Limit Theorem
- 11.2. Linear Regression
- 12. Datasets
- 13. R Resources
- 14. References
- Published with GitBook
How to Set Working Directory
We recommend that you create a PUBLG100 folder for all your work. Create this folder on N: drive if you're using a UCL computer or somewhere on your local disk if you're using a personal laptop.
Once the folder is created, use the setwd() function or RStudio menu to set your working directory.
1. Using the setwd() Function
| Recommended Folder Location | R Function | |
|---|---|---|
| UCL Computers | N: Drive | setwd("N:/PUBLG100") |
| Personal Laptop (Windows) | C: Drive | setwd("C:/PUBLG100") |
| Personal Laptop (Mac) | Home Folder | setwd("~/PUBLG100") |
2. Using RStudio Menu
You can also set the working directory using the menu in RStudio.

Notice that RStudio itself uses the setwd() function to set the working directory.
After you've set the working directory, verify it by calling the getwd() function.
getwd()Tag » How To Set Working Directory In R
-
Running RStudio And Setting Up Your Working Directory - STHDA
-
Getwd, Setwd | R Function Of The Day
-
How To Change Working Directory In R - Universe Of Data Science
-
Working Directories And Workspaces In The RStudio IDE
-
SET And GET Working Directory In R [setwd() And Getwd() Functions]
-
Get Or Set Working Directory - R
-
1.7 Working Directories | An Introduction To R
-
Setting Up Working Directory In R | R Tutorial 1.11 - YouTube
-
9.2 The Working Directory - YaRrr! The Pirate's Guide To R
-
Changing Working Directories In R | R - DataCamp
-
Chapter 12 Setting A Working Directory | R For HR: An Introduction To ...
-
Get And Set Working Directory In R - GeeksforGeeks
-
Set Working Directory To Source File Location In RStudio ...
-
7. Import And Save Data - R Tutorial