Clear startup screen in R / RStudio Clear startup screen in R / RStudio r r

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")


You can put this line to .bashrc in your home directory or .zshrc if you use zsh.

alias R='R -q'

-q means quiet.


Adding

cat('\f') 

to my .First() function in my .Rprofile works for me. I use Rstudio, (Windows 7, build 7601, Service Pack 1, x86)