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.
getwd返回R进程的当前工作目录的绝对文件路径;setwd(dir)用于设置工作目录dir。
用法----------Usage----------
getwd()
setwd(dir)
参数----------Arguments----------
参数:dir
A character string: tilde expansion will be done.
字符串:波浪线的扩建工程将于完成。
值----------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).
getwd返回一个字符串或NULL如果工作目录不可用。在Windows返回的路径将使用/作为路径分隔符,并在UTF-8编码。路径不会有一个尾随/除非是根目录(驱动器或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).
setwd返回之前改变当前目录,无形中与getwd相同的约定。它会给出一个错误,如果它没有成功(包括如果不实施)。
注意----------Note----------
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).
请注意,返回值被认为是绝对的文件路径</ STRONG> <STRONG>:到一个目录的路径可以有一个以上的代表和一些操作系统返回的值可以不同目录改变后变回相同的目录(例如,如果符号链接已走过)。
参见----------See Also----------
list.files for the contents of a directory.
list.files目录中的内容。
normalizePath for a "canonical" path name.
normalizePath“规范”的路径名。