choose.files(utils)
choose.files()所属R语言包:utils
Choose a List of Files Interactively
选择一个交互式文件列表
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Use a Windows file dialog to choose a list of zero or more files interactively.
使用Windows文件对话框,选择交互零个或多个文件列表。
用法----------Usage----------
choose.files(default = "", caption = "Select files",
multi = TRUE, filters = Filters,
index = nrow(Filters))
Filters
参数----------Arguments----------
参数:default
which filename to show initially
这名最初显示
参数:caption
the caption on the file selection dialog
文件选择对话框的标题
参数:multi
whether to allow multiple files to be selected
是否允许被选中多个文件
参数:filters
a matrix of filename filters (see Details)
一个文件名过滤器的矩阵(见详情)
参数:index
which row of filters to use by default
默认情况下使用过滤器的哪一行
Details
详情----------Details----------
Unlike file.choose, choose.files will always attempt to return a character vector giving a list of files. If the user cancels the dialog, then zero files are returned, whereas file.choose would signal an error. choose.dir chooses a directory.
与file.choose,choose.files总是会试图返回一个字符向量,给人一种文件列表。如果用户取消对话框,然后返回零文件,而file.choose会发出错误信号。 choose.dir选择一个目录。
Windows file dialog boxes include a list of "filters", which allow the file selection to be limited to files of specific types. The filters argument to choose.files allows the list of filters to be set. It should be an n by 2 character matrix. The first column gives, for each filter, the description the user will see, while the second column gives the mask(s) to select those files. If more than one mask is used, separate them by semicolons, with no spaces. The index argument chooses which filter will be used initially.
Windows文件对话框包括一个“过滤器”列表,这使得文件选择被限制到特定类型的文件。 filterschoose.files参数允许设置的过滤器列表。它应该是一个n字符矩阵2。给人的第一列,每个过滤器,用户将看到的描述,而第二列给出的面具(S)选择那些文件。如果使用一个以上的子网掩码,它们由分号分隔,没有空格。 index参数选择最初将被用于该过滤器。
Filters is a matrix giving the descriptions and masks for the file types that R knows about. Print it to see typical formats for filter specifications. The examples below show how particular filters may be selected.
Filters是一个矩阵,使的R知道的文件类型的描述和口罩。打印过滤器规格典型格式。下面的例子显示如何可以选择特定的过滤器。
If you would like to display files in a particular directory, give a fully qualified file mask (e.g., "c:\\*.*") in the default argument. If a directory is not given, the dialog will start in the current directory the first time, and remember the last directory used on subsequent invocations.
如果你想显示一个特定的目录中的文件,给一个完全合格的文件掩码(例如,"c:\\*.*")default参数。如果没有给出一个目录,对话将在当前目录开始的第一次,还记得上次的目录用于后续调用。
There is a buffer limit on the total length of the selected filenames: it is large but this function is not intended to select thousands of files, when the limit might be reached.
有一个缓冲区限制对选定的文件名的总长度:它是大的,但此功能不打算选择数千个文件时,可能达到的极限。
值----------Value----------
A character vector giving zero or more file paths.
一个特征向量,零个或多个文件路径。
参见----------See Also----------
file.choose, choose.dir.
file.choose,choose.dir。
Sys.glob or list.files to select multiple files by pattern.
Sys.glob或list.files选择模式由多个文件。
举例----------Examples----------
if (interactive())
choose.files(filters = Filters[c("zip", "All"),])
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|