Michael DiPersio
2008-May-09 18:52 UTC
[R] getWinProgressBar does not return previous value
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 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
Prof Brian Ripley
2008-May-10 06:07 UTC
[R] getWinProgressBar does not return previous value
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] 0It 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