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

R语言:browser()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-2-16 18:32:35 | 显示全部楼层 |阅读模式
browser(base)
browser()所属R语言包:base

                                        Environment Browser
                                         环境浏览器

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

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

Interrupt the execution of an expression and allow the inspection of the environment where browser was called from.
中断执行表达式允许browser被称为环境的检查。


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


browser(text="", condition=NULL, expr=TRUE, skipCalls=0L)



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

参数:text
a text string that can be retrieved once the browser is invoked.
一旦浏览器被调用,可以检索的文本字符串。


参数:condition
a condition that can be retrieved once the browser is invoked.
一旦浏览器被调用一个可以检索的条件。


参数:expr
An expression, which if it evaluates to TRUE the debugger will invoked, otherwise control is returned directly.
一个表达式,如果它的计算结果为TRUE调试器将调用,否则控制直接返回。


参数:skipCalls
how many previous calls to skip when reporting the calling context.
多少以前的调用跳过报告时调用上下文。


Details

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

A call to browser can be included in the body of a function. When reached, this causes a pause in the execution of the current expression and allows access to the R interpreter.
一个browser调用可以包含在一个函数体。到达时,这会导致暂停在当前表达式的执行,并允许访问的R解释。

The purpose of the text and condition arguments are to allow helper programs (e.g. external debuggers) to insert specific values here, so that the specific call to browser (perhaps its location in a source file) can be identified and special processing can be achieved.  The values can be retrieved by calling browserText and browserCondition.
text和condition参数是允许辅助程序(如外部调试器)插入特定的值,在这里,具体调用浏览器(可能是它在源文件中的位置),使能的目的确定和特殊处理,可以实现。可以检索调用browserText和browserCondition值。

The purpose of the expr argument is to allow for the illusion of conditional debugging. It is an illusion, because execution is always paused at the call to browser, but control is only passed to the evaluator described below if expr evaluates to TRUE. In most cases it is going to be more efficient to use an if statement in the calling program, but in some cases using this argument will be simpler.
expr参数的目的是允许有条件调试的假象。这是一种错觉,因为总是暂停执行在浏览器调用,但控制仅通过下文所述的评估如果expr值TRUE。在大多数情况下,它会是更有效地使用if语句在调用程序,但在某些情况下,使用这种说法会更简单。

The skipCalls argument should be used when the browser() call is nested within another debugging function:  it will look further up the call stack to report its location.
skipCallsbrowser()通话时,应使用参数嵌套在另一个调试功能:它会查找调用堆栈进一步报告其位置。

At the browser prompt the user can enter commands or R expressions, followed by a newline.  The commands are
在浏览器提示用户可以输入命令或R的表达,一个换行符。命令是:




c (or just an empty line, by default) exit the browser
c(或只是一个空行,默认情况下,)退出浏览器




cont synonym for c.
contc的代名词。




n enter the step-through debugger.  This changes the
n进入单步调试。这将改变




where print a stack trace of all active function calls.
where打印所有活跃的函数调用堆栈跟踪。




Q exit the browser and the current evaluation and
Q退出浏览器和当前的评价和

(Leading and trailing whitespace is ignored, except for an empty line).
(领导和结尾的空白将被忽略,除了一个空行)。

Anything else entered at the browser prompt is interpreted as an R expression to be evaluated in the calling environment: in particular typing an object name will cause the object to be printed, and ls() lists the objects in the calling frame.  (If you want to look at an object with a name such as n, print it explicitly.)
别的浏览器提示输入被解释为R的表达,在调用环境评估对象的名称,尤其是打字会导致要打印的对象,和ls()列出了在调用框架对象。 (如果你想看看在同一个名字n对象,它明确地打印。)

The number of lines printed for the deparsed call can be limited by setting options(deparse.max.lines).
可以印为deparsed呼叫行数限制设置options(deparse.max.lines)。

Setting option "browserNLdisabled" to TRUE disables the use of an empty line as a synonym for c.  If this is done, the user will be re-prompted for input until a valid command or an expression is entered.
设置选项"browserNLdisabled"TRUE禁用c使用一个空行的代名词。如果这样做,用户将被重新提示输入,直到输入一个有效的命令或表达。

This is a primitive function but does argument matching in the standard way.
这是一种原始的功能,但没有参数匹配标准。


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

The New S Language. Wadsworth & Brooks/Cole.
Programming with Data. A Guide to the S Language. Springer.

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

debug, and traceback for the stack on error. browserText for how to retrieve the text and condition.
debug,traceback错误堆栈。 browserText如何检索文本和条件。

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-1-23 21:28 , Processed in 0.024698 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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