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

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

[复制链接]
发表于 2012-2-26 08:04:46 | 显示全部楼层 |阅读模式
checkExists(oligoClasses)
checkExists()所属R语言包:oligoClasses

                                         Checks to see whether an object exists and, if not, executes the appropriate function.
                                         的检查,看是否存在一个对象,如果没有,执行相应的功能。

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

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

Only loads an object if the object name is not in the global environment.  If not in the global environment and the file exists, the object is loaded (by default). If the file does not exist, the function FUN is run.
只加载一个对象,如果不是在全球环境中的对象的名称。如果没有在全球环境和文件是否存在,该对象被加载(默认)。如果该文件不存在,运行功能的乐趣。


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


checkExists(.name, .path = ".", .FUN, .FUN2, .save.it=TRUE, .load.it, ...)



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

参数:.name
Character string giving name of object in global environment  
字符串,名称的对象,在全球环境


参数:.path
Path to where the object is saved.  
对象被保存的路径。


参数:.FUN
Function to be executed if <name> is not in the global environment and the file does not exist.  
要执行的函数如果<name>是不是在全球环境中,文件不存在。


参数:.FUN2
Not currently used.  
目前没有使用。


参数:.save.it
Logical.  Whether to save the object to the directory indicaged by path. This argument is ignored if the object was loaded from file or already exists in the .GlobalEnv.  
逻辑。是否保存该对象到pathindicaged目录。此参数将被忽略,如果对象是从文件中加载,或已经存在。GlobalEnv。


参数:.load.it
Logical.  If load.it is TRUE, we try to load the object from the indicated path.  The returned object will replace the object in the .GlobalEnv unless the object is bound to a different name (symbol) when the function is executed.  
逻辑。如果load.it为TRUE,我们尝试加载对象从指定的path。返回的对象将取代。GlobalEnv对象执行函数时,除非该对象被绑定到一个不同的名称(符号)。


参数:...
Additional arguments passed to FUN.  
额外的参数传递到乐趣。


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

Could be anything &ndash; depends on what FUN, FUN2 perform.  
可以是任何东西 - 取决于有什么好玩的,FUN2执行。

Future versions could return a 0 or 1 indicating whether the function performed as expected.
未来的版本可能返回一个0或1表示函数执行是否如预期。


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



R. Scharpf




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


path <- tempdir()
dir.create(path)
x <- 3+6
x <- checkExists("x", .path=path, .FUN=function(y, z) y+z, y=3, z=6)
rm(x)
x <- checkExists("x", .path=path, .FUN=function(y, z) y+z, y=3, z=6)
rm(x)
x <- checkExists("x", .path=path, .FUN=function(y, z) y+z, y=3, z=6)
rm(x)
##now there is a file called x.rda in tempdir().  The file will be loaded[#现在有一个文件名为x.rda TEMPDIR()。该文件将被加载]
x <- checkExists("x", .path=path, .FUN=function(y, z) y+z, y=3, z=6)
rm(x)
unlink(path, recursive=TRUE)

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-2-2 19:59 , Processed in 0.022516 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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