[R] clear console

Bert Gunter gunter.berton at gene.com
Sat Mar 31 16:29:19 CEST 2012


Will

cat(rep("\n",30))

do?
This does not remove any objects from the global environment. That requires ?rm

-- Bert


On Sat, Mar 31, 2012 at 5:09 AM, mrzung <mrzung46 at gmail.com> wrote:
> 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.
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



-- 

Bert Gunter
Genentech Nonclinical Biostatistics

Internal Contact Info:
Phone: 467-7374
Website:
http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm



More information about the R-help mailing list