Re: [R] colMeans in a data.frame with numeric and character data

From: Gabor Grothendieck <ggrothendieck_at_gmail.com>
Date: Thu, 27 Mar 2008 16:26:19 -0400

summaryBy in the doBy package can do that. The builtin iris data set has 4 numeric columns and one factor column:

> library(doBy)
> summaryBy(.~1, iris, fun = mean, keep = TRUE)
  Sepal.Length Sepal.Width Petal.Length Petal.Width 1 5.843333 3.057333 3.758 1.199333

On Thu, Mar 27, 2008 at 3:22 PM, Diogo André Alagador <dalagador_at_armail.pt> wrote:
> Hi all,
>
> I would like to know if it is posible by, someway, to get colMeans from
> a data.frame with numeric as well as character data, dispersed all over
> the object. Note that I would like to get colMeans neglecting character
> data.
>
> I am really in need of some function proceeding in that way…
>
> All the best
>
> Diogo André Alagador
>
> [[alternative HTML version deleted]]
>
>
> ______________________________________________
> 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 Thu 27 Mar 2008 - 20:30:51 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 Thu 27 Mar 2008 - 21:30:27 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