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.
setwd()
FunctionRecommended 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") |
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()