Possible Duplicate:
Function to Clear the Console in R
Is there a way to invoke the Clear Console (Ctrl+L) menu command programmatically?
I use a function for doing that, and actually have put it in {R directory}\etc\Rprofile.site so that it will always be available for use.
cls <- function() {
require(rcom)
wsh <- comCreateObject("Wscript.Shell")
comInvoke(wsh, "SendKeys", "\014")
invisible(wsh)
}
cls()
To clear the console give
cls()
P.S. The function doesn't work the first time it's called and that's why I invoke the function immediately after declaring it in Rprofile.site. As I recall, you may be asked to install some program, in order for this to work.
Create this function:
cls <- function() cat(rep("\n",100))
Then call it:
cls()
Works with:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With