[R] writing several command line in R console
Vincent Stoliaroff
vsensae at hotmail.com
Tue Mar 4 03:37:03 CET 2003
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
More information about the R-help
mailing list