
i
i
“K23166” — 2015/1/28 — 9:35 — page 50 — #76
i
i
i
i
i
i
50 CHAPTER 4. PROGRAMMING AND OPERATING SYSTEM INTERFACE
4.3.6 Change working directory
setwd("dir_location")
Note: The command setwd() changes the current working directory to the (absolute or
relative) pathname given as an argument (see file.choose()). This can also be done
interactively under Windows and Mac OS X by selecting the Change Working Directory
option under the Misc menu, or similar options on the Session menu in RStudio.
4.3.7 List and access files
list.files()
Note: The list.files() command returns a character vector of filenames in the current
directory (by default). Recursive listings