Clear startup screen in R / RStudio
Other guys are giving you advice how to stop the messages, I will take it the other way: how to clear the console. You can press Ctrl-L
manually. Of course, it would be nice to do this programmatically and place the appropriate command at the end of your system .RProfile
. I tried the obvious solution:
cat("\014") # or cat("\f")
but this apparently doesn't work. You can do this:
cat(rep("\n", 50))
which will clean your console, but the cursor is at the last line. Or you may try the solution proposed here (I've not tested it though - please report if it works if you try it):
cls <- function() { require(rcom) wsh <- comCreateObject("Wscript.Shell") comInvoke(wsh, "SendKeys", "\014") invisible(wsh)}
On linux console, the following could work:
system("clear")