[R] structure data

John Kane jrkrideau at yahoo.ca
Thu Nov 1 19:27:29 CET 2007


Have a look at ?aggregate or the doBy library.  They
may be what you want.
--- Antje <antje.niederlein at yahoo.de> wrote:

> Hello,
> 
> I have a quite simple question, I guess. I have a
> data frame and I would like 
> to process the data in several ways.
> The processing is dependent on grouping (factors)
> and the parameter itself. 
> Meaning for parameter1 in the df, I would like to
> calculate the mean and sd 
> when grouping by factor1. But parameter2 might be
> different. I thought of a 
> structure like this:
> 
> group1
>      param1   (mean, sd)
>      param2   (sum)
> 
> group2
>      param1   (mean, sd, median)
>      param2   (mean, sd)
> 
> I'm not sure how to build up this "processing info"
> structure. (The processing 
> itself will be later based on this structure).
> Would you use a list? (matrix and vector are not so
> flexible for different 
> length...)
> 
> Can anybody help m with this?
> 
> Antje
> 
> ______________________________________________
> 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.
>



More information about the R-help mailing list