找回密码
 注册
查看: 1323|回复: 0

R语言 tkWidgets包 fileBrowser()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-2-26 15:39:10 | 显示全部楼层 |阅读模式
fileBrowser(tkWidgets)
fileBrowser()所属R语言包:tkWidgets

                                        Simple Interface to View and Pick Files
                                         简单的界面,查看和选择文件

                                         译者:生物统计家园网 机器人LoveR

描述----------Description----------

This function provides the widget for users to go up and down a path and view the files.  When files are selected and the "End" button is pressed, the function returns a vector of character strings with the full paths of the selected files.
此功能提供了用户和路径,查看文件的部件。文件时选择"End"按下按钮,该函数返回一个字符串向量与选定的文件的完整路径。


用法----------Usage----------


fileBrowser(path="", testFun = function(x) TRUE, prefix = NULL,
            suffix = NULL, textToShow = "Select file(s)",
            nSelect = -1)



参数----------Arguments----------

参数:path
character string for the full path to be view. Defaults to the current working directory if no path is provided.
字符串是视图的完整路径。当前的工作目录,如果没有指定路径,提供默认值。


参数:testFun
function that checks to see if a given file name satisfies predefined requirements. The default is no checking.
函数来检查,看看是否一个给定的文件名满足预定要求。默认是没有检查。


参数:prefix
character string for a prefix used to screen out file names that do not have that prefix as part of their names.
用于筛选出作为其名称的一部分,没有前缀的文件名前缀字符串。


参数:suffix
character string for a suffix used to screen out file names that do not have that suffix as part of their names.
用于筛选出作为其名称的一部分,没有后缀的文件名后缀字符串。


参数:textToShow
character string to be shown on the widget to given instructions to users.
字符串的widget上显示的指示给用户。


参数:nSelect
integer indicating the number of files that should be selected.  No limitation if nSelect = -1 as per default.
整数,表示应选中的文件的数目。没有限制,如果nSelect = -1按默认。


Details

详情----------Details----------

When a path is viewed, files will be displayed as they are and directories will be displayed with a system file separator appended (e.g. "/" for Unix systems).  Single click on a file name will make the file selectable when the select button is pressed.  Multiple selection is possible by dragging with mouse button 1 pressed.  Double click on a directory name will go into that directory and display its files.  When a file/directory is selected and the "End" button pressed, the full path for the selected files selected will be returned.
当被视为一个路径,文件将被显示,因为它们将显示系统文件附加分隔符(例如"/"Unix系统)和目录。选择按钮被按下时,单点击文件名的文件可选择。拖动鼠标按钮1按下多重选择是可能的。双击目录名,将进入该目录,并显示其档案。当一个文件/目录被选中,按下“结束”按钮,选择选定的文件的完整路径将被退回。

The widget is modal and has to be closed by pressing the "End" button before doing any other operations. Functions, prefix, and suffix can be specified.         Examples of validity functions are hasPrefix and hasSuffix.
部件是模态的,有做任何其他操作之前,按“结束”按钮关闭。可以指定功能,前缀和后缀。有效性函数的例子是hasPrefix和hasSuffix。

The following is a list of the buttons and their associated behavior:
下面是一个按钮和其相关的行为的列表:




Up Moves the directory whose content is to be displayed in the box for file names one level up along the
Up移动,其内容是在框中要显示的文件名,沿上一级目录




Select \>\>  When a file or files in the box for file names in a directory have been highlighted by clicking or dragging mouse button 1 and this button is pushed, the highlighted file(s)
Select \>\> 当一个文件或目录中的文件名“框中的文件已强调通过点击或拖动鼠标按钮1,这个按钮被按下,高亮显示的文件(S)




\<\< Remove When a file or files in the box for selected files have been highlighted by clicking or dragging this
\<\< Remove当一个文件或文件中选定的文件框中通过点击或拖动这已经凸显




Clear Clears everything in the box for selected files
Clear清除一切在选定的文件箱




end Returns a vector containing all the names in the box for selected files or NULL if the box is empty.  The full path
end返回一个向量,包含所有选定的文件名,在箱或NULL如果盒子是空的。完整路径


值----------Value----------

A vector of character strings containing the full path of each file selected.
一个矢量字符字符串包含的每个文件的完整路径选择。


作者(S)----------Author(s)----------


Jianhua (John) Zhang



参见----------See Also----------

pickFiles,
pickFiles


举例----------Examples----------


## The example here is only run interactively since it requires user[#这里的例子是交互运行,因为它要求用户]
## interference which may cause problems if not available:[#这可能会导致问题,如果没有可用的干扰:]
if(interactive()) {

  # Call the function to view the current directory[调用该函数,以查看当前目录]
  flist <- fileBrowser()
  flist

  # To call the function with a path do[要调用路径功能]
  # fileBrowser(path = "yourPath")[fileBrowser(路径=“yourPath”)]
}

转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。


注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2025-1-23 03:26 , Processed in 0.036011 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表