[R] table of means/medians across bins used for a histogram
lalitha viswanath
lalithaviswanath at yahoo.com
Mon May 1 04:58:52 CEST 2006
Hi
I am trying to get a table of means of parameter 1
across BINS of parameter 2.
I am working in proteomics and a sample of my data is
as follows
cluster-age clock-rate(evolutionary rate) scopclass
0.002 10 A
0.045 0.1 B
0.13 15 A
0.15 34 D
....
....
....
....
Scop class has only 9 distinct categories (A-I)
Whereas cluster-age and clock-rate are discrete
variables greater than 0.
I am trying to do two things with this kind of data,
out of which I managed to accomplish one thanks to the
documentation and pre-existing queries on the mailing
lists.
1. Plot a histogram of the age distribution with scop
class category superimposed on each bin. I managed to
do this with barplot2.
2. Now I am trying to plot a scatter plot of the age
v/s the clock-rate. However to eliminate possible
sampling errors, we are trying to get an average of
the clock-rate for each of the bins used above.
i.e. before plotting a x-y plot, i wish to compute
average clock-rate in each of the bins for the age and
then plot a x-y plot of the age v/s clock rate.
Can anyone point me to appropriate functions for the
same?
I am trying to work with prop.table, cut, break, etc.
But I am not heading anywhere.
Thanks
Lalitha
More information about the R-help
mailing list