How do you clear the R console in OS X (or Ubuntu) [duplicate]
Possible Duplicate:
Function to Clear the Console in R
In bash, its like this:
$ clear
And I believe it's CTL-L in the Windows version of R. But how do you clear the R console in Unix-type开发者_高级运维 R Consoles? Do you need to write a special function and what would that look like?
Command+Option+L in R for Mac OS X
Ctrl+L in RStudio for Mac OS X
Since you ask for Ubuntu as well, it's simply Ctrl-L from a standard gnome-terminal.
I discovered that you call also type unix commands with the system()
function.
system('clear')
For what it's worth, my console to R is provided by ESS on whichever platform I use -- and as that is within Emacs, it is always Ctrl-l (or C-l in the common shorthand for Emacs).
Create this function:
cls <- function() cat(rep("\n",100))
Then call it:
cls()
Compatible with Windows, Linux and Mac.
精彩评论