[R] Column sums from a data frame (without the headers)

Jason Horn jason.w.horn at gmail.com
Fri Feb 29 18:02:46 CET 2008


Does anyone know how to get a vector of column sum from a data frame?   
You can use colSums(), but this gives you a object of type "numeric"  
with the column labels in the first row, and the sums in the second  
row.  I just want a vector of the sums, and I can't figure out a way  
to index the "numeric" object.

Thanks!



More information about the R-help mailing list