[R] getWinProgressBar does not return previous value

Prof Brian Ripley ripley at stats.ox.ac.uk
Sat May 10 08:07:12 CEST 2008


On Fri, 9 May 2008, Michael DiPersio wrote:

> I am trying to use winProgressBar, however I find that although
> setWinProgressBar updates the value on the screen, getWinProgressBar does
> not return this value.
> E.g
>> pb <- winProgressBar()
>> setWinProgressBar(pb, 0.2)
>> getWinProgressBar(pb)
> [1] 0

It does, but rounded to an integer.  Look at typeof() on the value, or

pb <- winProgressBar(max=100)
setWinProgressBar(pb, 20)
getWinProgressBar(pb)

It would be more flexible to allow the user to round, so I'll change it.


> I tried the same with tkProgressBar, and it is working as I would expect
> from the documentation.
>> pb <- tkProgressBar()
>> setTkProgressBar(pb, 0.5)
>> getTkProgressBar(pb)
> [1] 0.5
> ... and I get the same result using txtProgressBar .
>
> Does anyone using winProgressBar find the same behaviour, or know the reason
> for it?  A search for "winProgressBar" in R-help archive did not reveal
> anything, I believe it is a new function to v2.7.0.
>
>> sessionInfo()
> R version 2.7.0 (2008-04-22)
> i386-pc-mingw32
>
> locale:
> LC_COLLATE=English_United States.1252;LC_CTYPE=English_United
> States.1252;LC_MONETARY=English_United
> States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252
>
> attached base packages:
> [1] tcltk     stats     graphics  grDevices utils     datasets  methods
> [8] base
>
> Thanks,
>
> Michael
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-help mailing list