开发者

How do you clear the R console in OS X (or Ubuntu) [duplicate]

This question already has answers here: Closed 9 years ago.

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜