[R] Clear RGUI console under WinXP

From: <OlsenN_at_pac.dfo-mpo.gc.ca>
Date: Thu 12 May 2005 - 04:15:17 EST


Hi,
The recent thread on how to send mail from R got me thinking about a solution to clearing the rgui console under WinXP (something I've often wanted to do and I've seen others ask about). If you create a small vb script, say called "RClear.vbs":  

Dim wsh
Set wsh = CreateObject("WScript.Shell")
wsh.AppActivate "R Console"
wsh.SendKeys "^L"  

and copy this to the %windir%\system32 directory, you can create a function in R:  

clear.console <- function() {

   system(paste(Sys.getenv("windir"),"/system32/cscript.exe rclear.vbs",sep=""),

      intern=F, invisible=T)
}  

that will clear the the rgui console. Sorry for the redundancy if someone has already posted a similar solution.  

Norm Olsen
Fisheries and Oceans Canada

        [[alternative HTML version deleted]]



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Thu May 12 04:20:25 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:31:41 EST