library(gdata)
?keep
data(women, cars)
keep(cars)
## To remove all objects except cars, run:
## keep(cars, sure=TRUE)
"A big computer, a complex algorithm and a long time does not equal science." -- Robert Gentleman
Visualizzazione post con etichetta clear. Mostra tutti i post
Visualizzazione post con etichetta clear. Mostra tutti i post
lunedì 26 novembre 2007
domenica 6 maggio 2007
How to clear screen in R (Windows)
This tip (taken from this old thread) does work only under Windows:
See this StackOverflow Question for other solutions.
cls <- function() {
require(rcom)
wsh <- comCreateObject("Wscript.Shell")
comInvoke(wsh, "SendKeys", "\014")
invisible(wsh)
}
cls()or # An R function to clear the screen on RGui:
cls <- function() {
if (.Platform$GUI[1] != "Rgui")
return(invisible(FALSE))
if (!require(rcom, quietly = TRUE)) # Not shown any way!
stop("Package rcom is required for 'cls()'")
wsh <- comCreateObject("Wscript.Shell")
if (is.null(wsh)) {
return(invisible(FALSE))
} else {
comInvoke(wsh, "SendKeys", "\014")
return(invisible(TRUE))
}
}
cls()See this StackOverflow Question for other solutions.
Iscriviti a:
Commenti (Atom)