Re: [R] how to clear screen in R-console?

From: Paul Roebuck <roebuck_at_mdanderson.org>
Date: Sat 18 Feb 2006 - 05:14:57 EST

On Thu, 16 Feb 2006, Henrik Bengtsson wrote:

> On 2/16/06, Michael <comtech.usa@gmail.com> wrote:
>
> > On 2/16/06, Christian Schulz <ozric@web.de> wrote:
> > >
> > > >How to clear the screen in R-console?
> > >
> > > ctrl - e & l
> >
> > Any funcation that is callable from my program, instead of
> > pressing keys?
>
> depends on what type of terminal you are running. For example, if you
> run R in a VT100 terminal, you can try
>
> cat("The following VT100 escape sequence will clear the screen on a
> VT100 terminal\n")
> cat("\033[2J") # <ESC>[2J == Clear Screen
> cat("If the screen was cleared you should only see this sentence.\n")
>
> i.e.
>
> vt100ClearScreen <- function(...) cat("\033[2J")
>

On my terminal, this required the addition of cursor homing to replicate the effects of using the OS to clear the screen.

system_cls <- function() system("clear") vt100_cls <- function() cat("\033[2J\033[H")



SIGSIG -- signature too long (core dumped)

R-help@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 Received on Sat Feb 18 05:19:16 2006

This archive was generated by hypermail 2.1.8 : Mon 20 Feb 2006 - 14:08:40 EST