Here is a version that uses rcom instead of RDCOMClient.
This has the advantage that rcom is on CRAN.
cls <- function() {
require(rcom)
wsh <- comCreateObject("Wscript.Shell")
comInvoke(wsh, "SendKeys", "\014")
invisible(wsh)
}
cls() # test
On 2/17/06, Gabor Grothendieck <ggrothendieck at gmail.com> wrote:
Here is a translation of Norm Olsen's vbscript code into pure R.
This is intended for use with the Windows Rgui interface.
cls <- function() {
require(RDCOMClient)
wsh <- COMCreate("Wscript.Shell")
wsh$SendKeys("\014")
invisible(wsh)
}
cls() # invoke
On 2/17/06, Marcus Leinweber <leinweber at neuro.mpg.de> wrote:
-----Original Message-----
From: r-help-bounces at stat.math.ethz.ch
[mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Michael
Sent: Thursday, February 16, 2006 9:23 PM
To: Henrik Bengtsson
Cc: R-help at stat.math.ethz.ch
Subject: Re: [R] how to clear screen in R-console?
I am actually using Rgui on Windows...
What can I do?
There is no way to programmatically clear screen?