How To Set Working Directory | Introduction To Quantitative Methods

  • 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
A A Serif Sans White Sepia Night Share on Twitter Share on Google Share on Facebook Share on Weibo Share on Instapaper Introduction to Quantitative Methods

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