On Thu, 16 Feb 2006, Henrik Bengtsson wrote:

> On 2/16/06, Michael <[EMAIL PROTECTED]> wrote:
>
> > On 2/16/06, Christian Schulz <[EMAIL PROTECTED]> 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

Reply via email to