change working directory rstudio in command line code example Example: r set working directory setwd("/Users/SampleUser/Desktop/R")