r clear terminal code example
Example 1: r clear console
cat("\014")
Example 2: how to clear r terminal
cls <- function() {
require(rcom)
wsh <- comCreateObject("Wscript.Shell")
comInvoke(wsh, "SendKeys", "\014")
invisible(wsh)
}
cls()