Possible Duplicate:
Function to Clear the Console in R可能重复:函数在R中清除控制台
In bash, its like this:
在bash中,它是这样的:
$ 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?
我相信在Windows版本的R中它是CTL-L,但是如何在unix类型的R游戏机中清除R控制台呢?你需要写一个特殊的函数吗?
5 个解决方案
#1
41
Command+Option+L in R for Mac OS X
Mac OS X的命令+选项+L
Ctrl+L in RStudio for Mac OS X
在Mac OS X的RStudio中按Ctrl+L
#2
16
Since you ask for Ubuntu as well, it's simply Ctrl-L from a standard gnome-terminal.
既然你也要求Ubuntu,那么它就是从标准的gnome-terminal中Ctrl-L。
#3
8
I discovered that you call also type unix commands with the system()
function.
我发现您还可以使用system()函数调用unix命令。
system('clear')
#4
#5
1
Create this function:
创建这个函数:
cls <- function() cat(rep("\n",100))
Then call it:
然后调用它:
cls()
Compatible with Windows, Linux and Mac.
兼容Windows、Linux和Mac。
#1
41
Command+Option+L in R for Mac OS X
Mac OS X的命令+选项+L
Ctrl+L in RStudio for Mac OS X
在Mac OS X的RStudio中按Ctrl+L
#2
16
Since you ask for Ubuntu as well, it's simply Ctrl-L from a standard gnome-terminal.
既然你也要求Ubuntu,那么它就是从标准的gnome-terminal中Ctrl-L。
#3
8
I discovered that you call also type unix commands with the system()
function.
我发现您还可以使用system()函数调用unix命令。
system('clear')
#4
6
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).
值得注意的是,无论我使用哪个平台,我的控制台都是由ESS提供的——因为在Emacs中,它总是Ctrl-l(或者在Emacs的通用简写中是C-l)。
#5
1
Create this function:
创建这个函数:
cls <- function() cat(rep("\n",100))
Then call it:
然后调用它:
cls()
Compatible with Windows, Linux and Mac.
兼容Windows、Linux和Mac。