[R] control L to clear the Rgui screen in Windows

jim holtman jholtman at gmail.com
Fri Sep 29 04:33:00 CEST 2006


This I got from a previous answer.  You require the package 'rcom'

 cls.console  <-  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))
       }
}


On 9/28/06, Charles Annis, P.E.
<Charles.Annis at statisticalengineering.com> wrote:
> Greetings R-ians:
>
> Searching the Searchable Mail Archives I discovered that ctrl L will clear
> the Rgui screen, which is what I'd like to do from a print (or some similar)
> statement.
>
> Is there a mechanism to use the ctrl L clear-screen sequence in a script, or
> print statement?
>
> Thanks for your counsel.
>
> Charles Annis, P.E.
>
> Charles.Annis at StatisticalEngineering.com
> phone: 561-352-9699
> eFax: 614-455-3265
> http://www.StatisticalEngineering.com
>
>
> ______________________________________________
> R-help at stat.math.ethz.ch 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.
>


-- 
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem you are trying to solve?



More information about the R-help mailing list