Skip to content
Back to formatted view

Raw Message

Message-ID: <971536df0803271326r380b4002i59950e464bc2593d@mail.gmail.com>
Date: 2008-03-27T20:26:19Z
From: Gabor Grothendieck
Subject: colMeans in a data.frame with numeric and character data
In-Reply-To: <2D30AFCC9F414030AC5C56E63B43E1B8@Biochange>

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.
>
>