Get Or Set Working Directory - R
Maybe your like
| getwd {base} | R Documentation |
Get or Set Working Directory
Description
getwd returns an absolute filepath representing the current working directory of the R process; setwd(dir) is used to set the working directory to dir.
Usage
getwd() setwd(dir)Arguments
| dir | A character string: tilde expansion will be done. |
Details
See files for how file paths with marked encodings are interpreted.
Value
getwd returns a character string or NULL if the working directory is not available. On Windows the path returned will use / as the path separator and be encoded in UTF-8. The path will not have a trailing / unless it is the root directory (of a drive or share on Windows).
setwd returns the current directory before the change, invisibly and with the same conventions as getwd. It will give an error if it does not succeed (including if it is not implemented).
Note
Note that the return value is said to be an absolute filepath: there can be more than one representation of the path to a directory and on some OSes the value returned can differ after changing directories and changing back to the same directory (for example if symbolic links have been traversed).
See Also
list.files for the contents of a directory.
normalizePath for a ‘canonical’ path name.
Examples
(WD <- getwd()) if (!is.null(WD)) setwd(WD) [Package base version 4.6.0 Index]Tag » How To Set Working Directory In R
-
Running RStudio And Setting Up Your Working Directory - STHDA
-
Getwd, Setwd | R Function Of The Day
-
How To Change Working Directory In R - Universe Of Data Science
-
Working Directories And Workspaces In The RStudio IDE
-
SET And GET Working Directory In R [setwd() And Getwd() Functions]
-
1.7 Working Directories | An Introduction To R
-
Setting Up Working Directory In R | R Tutorial 1.11 - YouTube
-
9.2 The Working Directory - YaRrr! The Pirate's Guide To R
-
Changing Working Directories In R | R - DataCamp
-
Chapter 12 Setting A Working Directory | R For HR: An Introduction To ...
-
Get And Set Working Directory In R - GeeksforGeeks
-
How To Set Working Directory | Introduction To Quantitative Methods
-
Set Working Directory To Source File Location In RStudio ...
-
7. Import And Save Data - R Tutorial