[R] Mean of simulation runs given in a table

Irek Szczesniak irek.szczesniak at gmail.com
Tue Jan 17 12:31:59 CET 2012


Hi,

I have the simulation results of the following structure:

run par   measured
1   10    12
2   10    14
1   20    20
2   20    26

Where "run" is the simulation run number, "par" is the parameter of
the simulation, and "measured" is the value measured in the
simulation.  This is only a simple example of my results.  There are
many values measured and many parameters.  But the basic structure
stays the same: there are many runs (identified by the run number) for
the same values of the parameters with various measured values -- they
constitute a sample.

I would like to calculate the mean of the "measured" value for a
sample, and so I would like to obtain the output as follows:

par mean
10  13
20  23

I would appreciate it if someone could write me how to do it.


Thank you,
Irek



More information about the R-help mailing list