[R] structure data

Antje antje.niederlein at yahoo.de
Fri Nov 2 16:07:15 CET 2007


Okay, what I did so far is to create a list of a list of a list... I don't know 
whether this makes sense... (it's just initialized... I have to change it for 
individual cases) What do you think about?



plate.parameters <- c("param1","param2")

temp <- c("mean","sd")
vec <- vector("list",length(plate.parameters))
names(vec) <- plate.parameters
vec[] <- list(temp)

calculation.list <- list(vec,vec)
names(calculation.list) <- c("group1", "group2")



The term "parameter" means a measurement, e.g. param1 measures the size of 
objects, param2 is the measurement of the intensity of objects.


Antje



John Kane schrieb:
> Sorry I misunderstood the question.  My guess, and I'm
> afraid that's all it is is that you would be best off
> with a list.  I suppose you might even want lists of
> lists but I am not quite sure about what 'parameter'
> means here.  
> --- Antje <antje.niederlein at yahoo.de> wrote:
> 
>> Yes, I know, that these methods might help to
>> calculate but my question was 
>> more about how to structure the data that I can
>> realize this easy computation 
>> afterwards. Due to the flexibility I need, I would
>> like to avoid calculations I 
>> don't need...
>>
>> Antje
>>
>>
>> John Kane schrieb:
>>> 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.
>>>>
>>>
>>>
>> ______________________________________________
>> 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