EVOLUTION-MANAGER
Edit File: getwd.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Get or Set Working Directory</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for getwd {base}"><tr><td>getwd {base}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Get or Set Working Directory</h2> <h3>Description</h3> <p><code>getwd</code> returns an absolute filepath representing the current working directory of the <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> process; <code>setwd(dir)</code> is used to set the working directory to <code>dir</code>. </p> <h3>Usage</h3> <pre> getwd() setwd(dir) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>dir</code></td> <td> <p>A character string: <a href="path.expand.html">tilde expansion</a> will be done.</p> </td></tr> </table> <h3>Value</h3> <p><code>getwd</code> returns a character string or <code>NULL</code> if the working directory is not available. On Windows the path returned will use <code>/</code> as the path separator and be encoded in UTF-8. The path will not have a trailing <code>/</code> unless it is the root directory (of a drive or share on Windows). </p> <p><code>setwd</code> returns the current directory before the change, invisibly and with the same conventions as <code>getwd</code>. It will give an error if it does not succeed (including if it is not implemented). </p> <h3>Note</h3> <p>Note that the return value is said to be <strong>an</strong> 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). </p> <h3>See Also</h3> <p><code><a href="list.files.html">list.files</a></code> for the <em>contents</em> of a directory. </p> <p><code><a href="normalizePath.html">normalizePath</a></code> for a ‘canonical’ path name. </p> <h3>Examples</h3> <pre> (WD <- getwd()) if (!is.null(WD)) setwd(WD) </pre> <hr /><div style="text-align: center;">[Package <em>base</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>