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

R语言 track包 track.history()函数中文帮助文档(中英文对照)

  [复制链接]
发表于 2012-10-1 11:19:26 | 显示全部楼层 |阅读模式
track.history(track)
track.history()所属R语言包:track

                                         Functions for incrementally writing command history to a file.
                                         增量写入到一个文件中的命令历史功能。

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

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

These functions provide the ability to append recent commands to a history file after (almost) every top level command.  This makes it unnecessary to use savehistory() and solves the problem of command history not being saved on accidental or abnormal termination of an R session.
这些功能提供了最近的命令追加到历史文件后(几乎)所有顶层命令的能力。因此,不需要使用savehistory()和解决问题的命令历史记录不会被保存在意外或异常终止的R会话。


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


track.history.start(file = NULL, width = NULL, style = NULL, times =
  NULL, load = TRUE, verbose = FALSE, message="Session start")
track.history.stop()
track.history.status()
track.history.load(times = FALSE)
track.history.writer(expr, value, ok, visible)



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

参数:file
File to store the incremental history in.  Defaults to .Rincr_history.  
文件来存储增量的历史中。默认为.Rincr_history。


参数:width
Width to use deparsing for fast-style history saving.  Defaults to 120.  
宽度,使用deparsing为快速式记录保存。默认为120的。


参数:style
Two styles are possible:   
可能是两种风格:

full: (default) Use the internal R history mechanism.  This is slower, but it records everything typed at the command prompt, in the original formatting.  
full:(默认)使用内部研发的历史机制。这是慢,但是每一件事情都记在命令提示符下输入的,在原来的格式。

fast: Use deparsed version of the most recently executed command.  This is fast, but it doesn't record comments and some commands with errors, and it changes formatting.  
fast:使用deparsed的版本,最近执行的命令。这是快速的,但它不记录的意见和一些命令有错误的,它改变了格式化。


参数:times
Should time stamps be written to or read from the file?  The default behavior for track.history.start() is TRUE.  The default when loading history is FALSE, so that time stamps do not appear in the interactive history.  
如果时间戳记被写入或从文件中读取? track.history.start()的默认行为是TRUE。默认情况下,当加载历史是FALSE,所以时间不会出现在邮票互动历史。


参数:load
Should existing history be loaded when starting incremental history?  
如果现有的历史记录启动时自动加载增量历史?


参数:verbose
Should comments be printed?  
意见印?


参数:expr
Provided by the task callback  
所提供的任务回调


参数:value
Provided by the task callback  
所提供的任务回调


参数:ok
Provided by the task callback  
所提供的任务回调


参数:visible
Provided by the task callback  
所提供的任务回调


参数:message
A string to be written (once) to the incremental history file along with the date and time when incremental history tracking is started.
一个字符串被写入(一次)随着增量的历史文件的日期和时间时,开始增量历史跟踪。


Details

详细信息----------Details----------

Default values are taken first from options incr.hist.style, incr.hist.width,  incr.hist.file and incr.hist.times. If those option values don't exist, values are taken from environment variables R_INCR_HIST_STYLE,  R_INCR_HIST_WIDTH, R_INCR_HIST_FILE,  R_INCR_HIST_TIMES.
默认值是第一个从选项incr.hist.style,incr.hist.width,incr.hist.file和incr.hist.times。如果不存在这些选项的值,值是从环境变量R_INCR_HIST_STYLE,R_INCR_HIST_WIDTH,R_INCR_HIST_FILE,R_INCR_HIST_TIMES。

track.history.start() installs track.history.writer() as a task callback handler.
track.history.start()安装track.history.writer()回调处理程序的任务。

track.history.load() loads history from the file that incremental history is being written to.
track.history.load()加载的文件,增量历史正在被书写的历史。

track.history.stop() removes the task callback handler.
track.history.stop()中删除该任务的回调处理程序。

track.history.writer() is the task callback handler – it is not intended to be called by the user.
track.history.writer()是任务回调处理程序 - 它的目的不是要由用户调用。

If arguments are supplied to track.history.start(), their values are remembered in options() and used for the remainder of the session or until changed.
如果参数提供给track.history.start(),它们的值在options()记住,其余的会话,或直到更改。

The history stored using style="full" is more complete and accurate, in that it includes comments, unparseable commands, and original formatting.  It is somewhat slower because it is based on the internal history mechanism, which doesn't provide an easy way of identifying which are the new commands.  Consequently, when using style="full" track.history.writer() must inspect the entire internal history at the end of each command to work out which lines in it have been added since the last time history was written. However, the time difference seems negligible for interactive use on ordinary workstations circa 2010.
使用style="full"是更完整和准确的,因为它包括注释,不可解析的命令,和原来的格式存储的历史。这是有点慢,因为它是基于历史的内部机制,它不提供一个简单的方法确定哪些是新的命令。因此,当使用style="full"track.history.writer()必须检查整个内部历史上的每条命令结束工作线已加入自上次历史。然而,时间差大约2010年普通工作站上使用的互动似乎可以忽略不计。

To set up incremental history tracking automatically, put the following in your .Rprofile:
要设置自动跟踪增量历史,把下面的在您的.Rprofile:


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

track.history.status() returns a character string: "on" or "off". The other functions currently provide no useful return values.
track.history.status()返回一个字符串:"on"或"off"。其他的功能提供有用的返回值。


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



Tony Plate <a href="mailto:tplate@acm.org">tplate@acm.org</a>




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

addTaskCallback To read in command history that is stored in a particular file, use loadhistory(file). savehistory
addTaskCallback在命令历史记录中读取存储在一个特定的文件,使用loadhistory(file)。 savehistory


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


## Not run: [#不运行:]
## Can't use history except in Rgui and Rterm[#无法使用历史除了在RGUI和R项]
track.history.start()

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

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-4-18 11:15 , Processed in 0.025173 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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