November 2017
Beginner to intermediate
204 pages
5h 23m
English
Like the terminal, the R environment interacts with the filesystem relative to a particular directory. In R, the directory can be set directly in the script using the setwd() function.
It is helpful to set the working directory at the beginning of an R script to the location of the data. For this chapter, the working directory should be set to the ch6 project folder. I've added the following line to the beginning of my script - note that the path you use should be specific to the way your file system is set up:
setwd("~/Documents/book/ch6/ch6/")
In R, the forward slash / character can be used regardless of operating system. After adding a line to set the working directory, you can execute the line by moving ...
Read now
Unlock full access