ProgressBarText-class(affy)
ProgressBarText-class()所属R语言包:affy
Class "ProgressBarText"
类“ProgressBarText”
译者:生物统计家园网 机器人LoveR
描述----------Description----------
A class to handle progress bars in text mode.
A类处理在文本模式下的进度条。
类的对象----------Objects from the Class----------
Objects can be created by calls of the form new("ProgressBarText", steps).
创建对象可以通过检测的形式new("ProgressBarText", steps)。
插槽----------Slots----------
steps: Object of class "integer". The total number of
steps类"integer"的对象。总数
barsteps: Object of class "integer". The size of the
barsteps类"integer"的对象。的大小
internals: Object of class "environment".
internals类"environment"的对象。
方法----------Methods----------
close signature(con = "ProgressBarText"): Terminate the progress bar (i.e. print what needs to be printed). Note that closing the instance will ensure the progress bar is plotted to
关闭signature(con = "ProgressBarText"):终止进度条(即打印需要打印什么)。请注意,关闭该实例将确保进度条绘制
initialize signature(.Object = "ProgressBarText"):
初始化signature(.Object = "ProgressBarText"):
open signature(con = "ProgressBarText"): Open a progress bar (i.e. print things). In the case open is called on a progress bar that was 'progress', the progress bar is resumed (this might be useful when one wishes to insert text output while
打开signature(con = "ProgressBarText"):打开一个进度条(即打印的东西)。开放的情况下被称为是“进步”的进度条,进度条恢复(这可能是有用的,希望插入文本的输出,而当一个人
updateMe signature(object = "ProgressBarText"): Update
updateMesignature(object = "ProgressBarText"):更新
作者(S)----------Author(s)----------
Laurent
举例----------Examples----------
f <- function(x, header = TRUE) {
pbt <- new("ProgressBarText", length(x), barsteps = as.integer(20))
open(pbt, header = header)
for (i in x) {
Sys.sleep(i)
updateMe(pbt)
}
close(pbt)
}
## if too fast on your machine, change the number[#如果太快你的机器上,更改检测号码]
x <- runif(15)
f(x)
f(x, header = FALSE)
## 'cost' of the progress bar:[#“成本”的进度条:]
g <- function(x) {
z <- 1
for (i in 1:x) {
z <- z + 1
}
}
h <- function(x) {
pbt <- new("ProgressBarText", as.integer(x), barsteps = as.integer(20))
open(pbt)
for (i in 1:x) {
updateMe(pbt)
}
close(pbt)
}
system.time(g(10000))
system.time(h(10000))
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|