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

From: Ben Fairbank <BEN_at_ssanet.com>
Date: Fri, 29 Feb 2008 11:15:33 -0600

as.vector(col.Sums())

Ben

-----Original Message-----
From: r-help-bounces_at_r-project.org [mailto:r-help-bounces_at_r-project.org] On Behalf Of Jason Horn
Sent: Friday, February 29, 2008 11:03 AM To: R-help_at_stat.math.ethz.ch
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_at_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_at_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. Received on Fri 29 Feb 2008 - 17:18:40 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 29 Feb 2008 - 17:30:18 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive