change r working directory permanently code example Example: r set working directory setwd("/Users/SampleUser/Desktop/R")