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

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

[复制链接]
发表于 2012-9-30 11:24:00 | 显示全部楼层 |阅读模式
runExample(SoDA)
runExample()所属R语言包:SoDA

                                        Run or access example files
                                         运行或访问示例文件

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

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

This function finds and runs a file,  usually of R code.  The function is specialized to look for examples included in the package and based on material in Software for Data Analysis, but can be used for other directories containing source files as well.
此功能查找并运行一个文件,通常R代码。该功能是专门寻找包中包含的软件进行数据分析,并根据材料的例子,但可用于其他包含源文件的目录。


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


runExample(what, where = , run = TRUE, ..., echo = TRUE, prompt.echo, wd)



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

参数:what
Identifies the example to be run.  Can be either a  character string name of the file to be run, possibly without the suffix or the page in  Software for Data Analysis where the example appears.  See exampleFiles for details.  
标识要运行的例子。可以是一个字符串的文件名来运行,可能不带后缀或软件用于数据分析的例子出现的页面。见exampleFiles的详细信息。


参数:where
The character string name of the package or directory in which the files are to be found.  By default, and usually, it is the SoDA package.  If a package name is given, that package must have an "Examples" directory.
字符串名称的包或目录中的文件被发现。默认情况下,通常情况下,它是SoDA包。如果一个包的名称,该包必须有一个"Examples"目录。


参数:run
Should the example code be run, or only parsed, assuming it is R source code?
运行的示例代码,或只解析,假设它是R的源代码吗?


参数:..., echo, prompt.echo
Any optional arguments to the source function, assuming run is TRUE. The default for prompt.echo is constructed from an abbreviation of the file name.  
任何可选参数,假设source是run,TRUE功能。 prompt.echo的默认构造的文件名的缩写。


参数:wd
The working directory in which to run the example. If the argument is missing and where is a package, the working directory is the package directory, which is also the parent directory of the Examples directory.  If where is a directory and not a package, and wd is missing, then the working directory is not changed. Otherwise, the working directory is set before running the example and reset after.  As you would hope, this argument is ignored if run is FALSE.  
工作目录,在其中运行的例子。如果该参数被失踪,where是一个包,工作目录是包的目录,这也是Examples目录的父目录。如果where是一个目录,而不是一个包,wd缺少,那么工作目录没有改变。否则,工作目录设置运行本示例之前,复位后。正如你所希望的,这个参数将被忽略,如果run是FALSE。


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

If the file is an R source file, the function returns either the value from source or the parsed version of the file, according to whether run is TRUE.
如果该文件是R的源文件,该函数返回的值从source或解析版本的文件,根据是否run是TRUE。

For non-R files, the value is currently just the character vector containing the lines of the file.  Future versions may be a little more clever.
对于非-R文件,该值是目前只是其中包含的文件的行的字符矢量。未来的版本可能会更聪明一点。


参考文献----------References----------



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

demoSource for a more interactive way to run a file of R code, and exampleFiles for direct access to
demoSource一个更加互动的方式运行文件R代码,exampleFiles可以直接访问


实例----------Examples----------


## Not run: [#不运行:]
runExample("madCall")  # run file "madCall.R"[运行文件“madCall.R”]
runExample(53) # the example appearing on page 53 of the book.[的例子出现在第53页的书。]

## End(Not run)[#(不执行)]

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-6-9 05:11 , Processed in 0.037817 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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