Thank you Greg,

This is what I figured out... The problem with txtProgressBar() is that many packages display some information during installation (even with quiet=TRUE), especially the installation of dependencies, so that the progress bar is not very useful. So I have tried with tkProgressBar() and it seems to work, although it takes some time to initialize.

Ivan

--
Ivan Calandra, PhD
Scientific Mediator
University of Reims Champagne-Ardenne
GEGENAA - EA 3795
CREA - 2 esplanade Roland Garros
51100 Reims, France
+33(0)3 26 77 36 89
ivan.calan...@univ-reims.fr
--
https://www.researchgate.net/profile/Ivan_Calandra
https://publons.com/author/705639/

Le 20/07/2016 à 17:39, Greg Snow a écrit :
You need to figure out how to tell txtProgressBar what the progress is.

One simple option would be that if you are installing 10 packages,
then create the bar with a range of values from 0 to 10 and initialize
it at 0, then after the first package installs update it to show 1,
after the 2nd installs update it to show 2, etc. until all 10 are
installed.

This is the simplest from the programming side, but the packages may
take different amounts of time to install.  If you have a feel for how
long they take to install (relative to each other) then you can
incorporate this with a percentage, e.g. after the 1st package
installs you may set the bar to 28%, after the second installs you may
then update it to 31%, etc. with the jumps proportional to expected
time to install.


On Wed, Jul 20, 2016 at 2:00 AM, Ivan Calandra
<ivan.calan...@univ-reims.fr> wrote:
Dear useRs,

In a script that will be source()d, I want to install the uninstalled
packages and follow the progression with a bar. So I looked at
txtProgressBar() but I cannot figure out how to use it to show the
progression of the installation.

All the examples I have found just display the progress of... the progress
bar itself ?

Any idea?

Thanks in advance,
Ivan

--
Ivan Calandra, PhD
Scientific Mediator
University of Reims Champagne-Ardenne
GEGENAA - EA 3795
CREA - 2 esplanade Roland Garros
51100 Reims, France
+33(0)3 26 77 36 89
ivan.calan...@univ-reims.fr
--
https://www.researchgate.net/profile/Ivan_Calandra
https://publons.com/author/705639/

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.



______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

Reply via email to