recover(utils)
recover()所属R语言包:utils
Browsing after an Error
错误后浏览
译者:生物统计家园网 机器人LoveR
描述----------Description----------
This function allows the user to browse directly on any of the currently active function calls, and is suitable as an error option. The expression options(error=recover) will make this the error option.
此功能允许用户浏览目前活跃的函数调用的任何直接的,是适合作为错误选项。 options(error=recover)将使这个错误选项。
用法----------Usage----------
recover()
Details
详情----------Details----------
When called, recover prints the list of current calls, and prompts the user to select one of them. The standard R browser is then invoked from the corresponding environment; the user can type ordinary R language expressions to be evaluated in that environment.
调用时,“recover打印当前呼叫列表,并提示用户选择其中之一。标准Rbrowser然后调用相应的环境,用户可以键入普通的R语言表达,要在这种环境评估。
When finished browsing in this call, type c to return to recover from the browser. Type another frame number to browse some more, or type 0 to exit recover.
当完成此调用浏览,类型crecover从浏览器。键入另一个车架号浏览更多一些,或类型0退出recover。
The use of recover largely supersedes dump.frames as an error option, unless you really want to wait to look at the error. If recover is called in non-interactive mode, it behaves like dump.frames. For computations involving large amounts of data, recover has the advantage that it does not need to copy out all the environments in order to browse in them. If you do decide to quit interactive debugging, call dump.frames directly while browsing in any frame (see the examples).
recover很大程度上取代使用dump.frames作为错误选项,除非你真的要等待看的错误。如果recover被称为非交互模式,它的行为像dump.frames。对于涉及大量的数据计算,recover具有的优势在于它不需要复制所有的环境,以便在他们浏览。如果你决定退出交互式调试,打电话dump.frames直接浏览,而在任何帧(见例子)。
值----------Value----------
Nothing useful is returned. However, you can invoke recover directly from a function, rather than through the error option shown in the examples. In this case, execution continues after you type 0 to exit recover.
返回没什么用处。然而,你可以调用recover直接从一个函数,而不是通过示例中所示的错误选项。在这种情况下,继续执行后键入0退出recover。
兼容性注意----------Compatibility Note----------
The R recover function can be used in the same way as the S function of the same name; therefore, the error option shown is a compatible way to specify the error action. However, the actual functions are essentially unrelated and interact quite differently with the user. The navigating commands up and down do not exist in the R version; instead, exit the browser and select another frame.
的Rrecover功能可以使用同样的方式在为S函数的名称相同;因此,显示的错误选项是兼容的方式,到指定的错误行动。然而,实际的功能基本上无关,与用户交互的完全不同。航行命令up和downR版本不存在,而是退出浏览器,并选择另一个框架。
参考文献----------References----------
Programming with Data; Springer. <br> See the compatibility note above, however.
参见----------See Also----------
browser for details about the interactive computations; options for setting the error option; dump.frames to save the current environments for later debugging.
browser关于交互式计算的细节; options设置错误选项;dump.frames保存当前的环境,为以后调试。
举例----------Examples----------
## Not run: [#无法运行:]
options(error = recover) # setting the error option[设置错误选项]
### Example of interaction[#示例互动]
> myFit <- lm(y ~ x, data = xy, weights = w)
Error in lm.wfit(x, y, w, offset = offset, ...) :
missing or negative weights not allowed
Enter a frame number, or 0 to exit
1:lm(y ~ x, data = xy, weights = w)
2:lm.wfit(x, y, w, offset = offset, ...)
Selection: 2
Called from: eval(expr, envir, enclos)
Browse[1]> objects() # all the objects in this frame[在这个框架中的所有对象]
[1] "method" "n" "ny" "offset" "tol" "w"
[7] "x" "y"
Browse[1]> w
[1] -0.5013844 1.3112515 0.2939348 -0.8983705 -0.1538642
[6] -0.9772989 0.7888790 -0.1919154 -0.3026882
Browse[1]> dump.frames() # save for offline debugging[保存为离线调试]
Browse[1]> c # exit the browser[退出浏览器]
Enter a frame number, or 0 to exit
1:lm(y ~ x, data = xy, weights = w)
2:lm.wfit(x, y, w, offset = offset, ...)
Selection: 0 # exit recover[退出恢复]
>
## End(Not run)[#结束(不运行)]
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|