[R] transform R function

2007-03-07 Thread lamack lamack
Dear all, Why the transform function does not accept two statistics functions? a = data.frame(matrix(rnorm(20),ncol=2)) transform(a,M.1=mean(X1),M.2=mean(X2)) # does not works #while: transform(a,M.1=mean(X1),M2=log(abs(X2))) #works Best regards JL

Re: [R] transform R function

2007-03-07 Thread Peter Dalgaard
lamack lamack wrote: Dear all, Why the transform function does not accept two statistics functions? a = data.frame(matrix(rnorm(20),ncol=2)) transform(a,M.1=mean(X1),M.2=mean(X2)) # does not works #while: transform(a,M.1=mean(X1),M2=log(abs(X2))) #works It's a variation of this