From the course: R for Data Science: Lunch Break Lessons

Unlock this course with a free trial

Join today to access over 22,700 courses taught by industry experts.

txtProgressBar

txtProgressBar

- [Instructor] If you're running a long calculation it's a nice thing to have some indicator of the progress of that calculation, that's what txtProgressBar is all about. To use that the first thing you need to do is create a txtProgressBar and if you look in line three you can see that I've used textProgressBar to create myProgressBar. So I run that. On the right hand side you can see that I now have myProgressBar which is a list of three and it's not important what's in the list what is important is how to use it. In line five I create a vector called ticks and assign zero to it. In line seven, eight, nine and 10 is where I set up a while loop that is doing the calculation. Now in this case all the while loop is doing is displaying the txtProgressBar, but when I run this you'll see that there is an equal sign that creeps across the bottom of the screen indicating how many times I've gone through the while loop. I'm going to stop the execution of this program and don't forget to…

Contents