Day 06 – little helper statusbar
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
We at STATWORX work a lot with R and we often use the same little helper functions within our projects. These functions ease our daily work life by reducing repetitive code parts or by creating overviews of our projects. At first, there was no plan to make a package, but soon I realised, that it will be much easier to share and improve those functions, if they are within a package. Up till the 24th December I will present one function each day from helfRlein
. So, on the 6th day of Christmas my true love gave to me…
What can it do?
This little helper prints a progress bar into the console for loops.
There are two nessecary parameters to feed this function:
run
is either the iterator or its numbermax.run
is either all possible iterators in the order they are processed or the maximum number of iterations.
So for example it could be
run = 3
andmax.run = 16
orrun = "a"
andmax.run = letters[1:16]
.
Also there are two optional parameter:
percent.max
influences the width of the progress barinfo
is an additional character, which is printed at the end of the line. By default it isrun
.
A little disadvantage of this function is, that it does not work with parallel processes. If you want to have a progress bar when using apply
functions check out pbapply
.
Overview
To see all the other functions you can either check out our GitHub or you can read about them here.
Have a merry advent season!
STATWORX
is a consulting company for data science, statistics, machine learning and artificial intelligence located in Frankfurt, Zurich and Vienna. Sign up for our NEWSLETTER and receive reads and treats from the world of data science and AI.
Der Beitrag Day 06 – little helper statusbar erschien zuerst auf STATWORX.
R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.