On Thu, 2007-10-25 at 15:34 +1000, [EMAIL PROTECTED] wrote:
> There are many simple ways to do this, if I understand you correctly.
> Here is an example
>
> > dat <- data.frame(matrix(rnorm(25), 5, 5))
> > names(dat)
> [1] "X1" "X2" "X3" "X4" "X5"
> > vars <- names(dat)[-1]
> > vars
> [1] "X2" "X3
There are many simple ways to do this, if I understand you correctly.
Here is an example
> dat <- data.frame(matrix(rnorm(25), 5, 5))
> names(dat)
[1] "X1" "X2" "X3" "X4" "X5"
> vars <- names(dat)[-1]
> vars
[1] "X2" "X3" "X4" "X5"
> myfunc <- function(x) print(mean(x))
> for(i in dat[, vars]) myf
2 matches
Mail list logo