[R] clear console

mrzung mrzung46 at gmail.com
Sat Mar 31 14:09:22 CEST 2012


hi,

I use  R - 2.15(32bit), and want to make a code to clear a console.

Actually, I used to run following code to do that but after update the
version of R from 2.14 to 2.15, it doesn't work.

cls <- function (t) { 
        require(RDCOMClient) 
        wsh <- COMCreate("Wscript.Shell") 
        wsh$SendKeys("\f") 
        invisible(wsh) 
}
cls()

or

cls <- function() { 
require(rcom) 
wsh <-comCreateObject("Wscript.Shell") 
comInvoke(wsh, "SendKeys", "\f") 
invisible(wsh) 
}

cls()

Can anybody help me to solve this problem?

Thanks.

--
View this message in context: http://r.789695.n4.nabble.com/clear-console-tp4521532p4521532.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list