[R] writing several command line in R console

Petr Pikal petr.pikal at precheza.cz
Tue Mar 4 09:38:03 CET 2003


Hallo

On 4 Mar 2003 at 2:36, Vincent Stoliaroff wrote:

> 
> Hi R lovers
> 
> I would like to know how to step to the next line in the R console
> editor without breaking the continuity of my code more clearly : if
> for example I write a function, so far i have to write the all code
> inside on the same line wich may become obscure as the function is
> more and more complex. I would like to do like in the example of the
> manuels:
> 
> >twosam <- function(y1, y2) {
>     n1  <- length(y1); n2  <- length(y2)
>     yb1 <- mean(y1);   yb2 <- mean(y2)    s1  <- var(y1);    s2  <-
>     var(y2) s <- ((n1-1)*s1 + (n2-1)*s2)/(n1+n2-2) tst <- (yb1 -
>     yb2)/sqrt(s2*(1/n1 + 1/n2))    tst  }
> 
> 
> all I can do is something like that:
> 
> >twosam <- function(y1, y2) {    n1  <- length(y1); n2  <- length(y2)
> 
> +    yb1 <- mean(y1);   yb2 <- mean(y2)    s1  <- var(y1);    s2  <-
> +    var(y2) s <- ((n1-1)*s1 + (n2-1)*s2)/(n1+n2-2)
> +   tst <- (yb1 - yb2)/sqrt(s2*(1/n1 + 1/n2))    tst  }
> 
> with the sign "+" in front of each line
> What does this sign mean? and how could I solve my problems
> Thanks

Maybe looking to the manuals will be more precise than my 
answer.

+ is a continuity sign and means you did not finished your imput 
and you shall continue typing your command.

But why you do not use any text ditor for writing functions and 
than copy/paste to R command window?




> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> http://www.stat.math.ethz.ch/mailman/listinfo/r-help

CheersPetr Pikal
petr.pikal at precheza.cz
p.pik at volny.cz




More information about the R-help mailing list