Re: [R] Equivalent to apply(x[,2:5],1,sum) for dataframe

2008-11-21 Thread Dieter Menne
Agustin Lobo-4 wrote: > > What's the most correct way of doing the equivalent to > apply(x[,2:5],1,sum) > > if x is dataframe in which the only numeric fields are > in columns 2:5 ? > (using apply returns a character vector) > Could it be that you meant apply(x[,2:5],2,sum)? Not very easy to

[R] Equivalent to apply(x[,2:5],1,sum) for dataframe

2008-11-21 Thread Agustin Lobo
What's the most correct way of doing the equivalent to apply(x[,2:5],1,sum) if x is dataframe in which the only numeric fields are in columns 2:5 ? (using apply returns a character vector) Thanks Agus -- Dr. Agustin Lobo Institut de Ciencies de la Terra "Jaume Almera" (CSIC) LLuis Sole Sabaris