I am executing some R scripts with a source()
command and then flushing the console. The only thing that I want visible in the console is some text with a progress report of the script, after that some progress bars are displayed, all the rest of the code is hidden. I am printing my progress report to the console by manually adding the text using the cat()
function as below.
cat("\014")
cat(" =====================================\n")
cat(" ========== PROGRESS REPORT ==========\n")
cat(" =====================================\n")
cat("\n")
# progress bar implementation
What I was wondering: Is there a way to center the text automatically in the middle of the console so that it adjusts dynamically when you resize the window size of the console? I am looking for a way that works both in R Studio and also baseR in Windows and Mac OS X.