tempfile(base)
tempfile()所属R语言包:base
Create Names for Temporary Files
创建临时文件的名称
译者:生物统计家园网 机器人LoveR
描述----------Description----------
tempfile returns a vector of character strings which can be used as names for temporary files.
tempfile返回一个字符字符串可作为临时文件的名称使用的向量。
用法----------Usage----------
tempfile(pattern = "file", tmpdir = tempdir(), fileext = "")
tempdir()
参数----------Arguments----------
参数:pattern
a non-empty character vector giving the initial part of the name.
一个非空字符向量给予初始部分的名称。
参数:tmpdir
a non-empty character vector giving the directory name
一个非空字符向量,给出目录名
参数:fileext
a non-empty character vector giving the file extension
一个非空字符向量,提供的文件扩展名
Details
详情----------Details----------
The length of the result is the maximum of the lengths of the three arguments; values of shorter arguments are recycled.
结果长度是最大的三个参数的长度较短的参数值被回收。
The names are very likely to be unique among calls to tempfile in an R session and across simultaneous R sessions (unless tmpdir is specified). The filenames are guaranteed not to be currently in use.
该名称很可能是唯一在调用tempfileR会话和跨同时R会话(除非tmpdir指定)。保证不会在目前使用的文件名。
The file name is made by concatenating the path given by tmpdir, the pattern string, a random string in hex, and a suffix of fileext.
串联路径的文件名tmpdir,pattern字符串,在十六进制随机字符串,和fileext的后缀。
By default, tmpdir will be the directory given by tempdir(). This will be a subdirectory of the temporary directory found by the following rule. The environment variables TMPDIR, TMP and TEMP are checked in turn and the first found which points to a writable directory is used: if none succeeds the value of R_USER (see Rconsole) is used. If the path to the directory contains a space in any of the components, the path returned will use the shortnames version of the path.
默认情况下,tmpdir会是tempdir()给目录。这将是一个符合以下规则的临时目录的子目录。环境变量TMPDIR,TMP和TEMP检查反过来,找到的第一个用于指向一个可写目录:如果没有成功的价值R_USER(见Rconsole)使用。如果目录路径包含任何组件的空间,返回的路径将使用的路径shortnames的版本。
值----------Value----------
For tempfile a character vector giving the names of possible (temporary) files. Note that no files are generated by tempfile.
tempfile字符向量给予(临时)文件的名称。请注意,没有文件生成tempfile。
For tempdir, the path of the per-session temporary directory.
tempdir,每个会话的临时目录的路径。
Both will use backslash as the path separator.
双方将使用反斜杠作为路径分隔符。
注意:在平行----------Note on parallel----------
R processes produced by function such as mclapply in package parallel (or multicore) share a per-session temporary directory. Further, the "guaranteed not to be currently in use" applies only at the time of asking, and two children could ask simultaneously. As from R 2.14.1 this is avoided by ensuring that tempfile calls in different children look for different names.
ŕ处理生产mclapply包parallel(multicore)份额每一个会话的临时目录等功能。此外,“保证是目前使用的”只适用于在要求的时间,并可以同时问两个孩子。从R 2.14.1是可以避免确保tempfile要求在不同的孩子,看看不同的名字。
参考文献----------References----------
The New S Language. Wadsworth & Brooks/Cole.
参见----------See Also----------
unlink for deleting files.
unlink删除文件。
举例----------Examples----------
tempfile(c("ab", "a b c")) # give file name with spaces in![在空间给文件名!]
tempfile("plot", fileext=c(".ps", ".pdf"))
tempdir() # works on all platforms with a platform-dependent result[在所有平台上的作品与平台相关的结果]
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|