as.vector(col.Sums())

Ben 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Jason Horn
Sent: Friday, February 29, 2008 11:03 AM
To: [EMAIL PROTECTED]
Subject: [PS] [R] Column sums from a data frame (without the headers)

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!

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to