Description Objects from the Class progress.file constructor progress.console constructor Common slots progress.console slots progress.file slots Methods Author(s) Examples
The two last classes inherit from the first one, and describe textual progression outputs.
progress
is an abstract class that should not be instantiated.
progress.file
and progress.console
objects are to be created by the new
function, as initialize
methods are implemented for each of them.
See the Examples section.
Objects can be created by new
with the following arguments :
main
:Directly transfered in the appropriate slot
iMax
:Directly transfered in the appropriate slot
iCurrent
:Directly transfered in the appropriate slot
nSteps
:Approximative amount of steps, to pass to pretty
Objects can be created by new
with the following arguments :
main
:Directly transfered in the appropriate slot
iMax
:Directly transfered in the appropriate slot
iCurrent
:Directly transfered in the appropriate slot
main
:Single character value, the title to print at beginning
iMax
:Single integer value, the maximum value for the iteration index
iCurrent
:Single integer value, the current value of the iteration index
pTimes
:Float vector, proc.time
returns used to compute the ETA
eraseLength
:Single integer value, nchar
in the previous output
steps
:Integer vector, iteration indexes for which print an output
Constructors of the classes, see previous sections.
Updates a progression objects. Takes two arguments : progress
(the object to update) and iCurrent
, the new value for the iteration index. On each update, a message
will be printed according to the class of the updated object.
Sylvain Mareschal
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | # File oriented progression
testFun = function() {
obj <- new("progress.file", main="Iterating", iMax=20)
for(i in 1:20) {
obj = set(obj, i)
Sys.sleep(0.1)
}
}
testFun()
# Console oriented progression
testFun = function() {
obj <- new("progress.console", main="Iterating", iMax=20)
for(i in 1:20) {
obj = set(obj, i)
Sys.sleep(0.1)
}
}
testFun()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.