I am stuck how to solve a problem. I have a matrix with the following format:
Sequence Position Raw Binding (log ratio)
UC001AOZ.3 146 -0.746
UC001AOZ.3 147 -1.27
UC001AOZ.3 148 -1.66
UC001AOZ.3 149 -2.16
UC001AOZ.3 150 -2.08
... ... ...
UC222AOF.2 5000 1.22
UC222AOF.2 146 -1.12
UC222AOF.2 147 -1.41
... ... ...
UC222AOF.2 5000 5.13
... ... ...
The first column (Sequence) describes genes by these cryptic names. The second column is a position within the human genome and the third column refers to a value for an event.
The position goes up to 5000 and starts then at 146 again for the next gene (see format, second gene name "UC222AOF.2"). In total are there 250 genes with 4854 positions and respective Raw Biding values.
I want to get mean values of all Raw Binding (log ratio) values at the positions between 146 and 5000.
One possibility could look like this (values might be different than above):
146 147 148 149 ... 5000
UC001AOZ.3 -0.746 -1.27 -1.66 -2.16 ... 1.22
UC222AOF.2 -1.12 -1.41 -1.31 -1.81 ... 5.13
UC002BW1.1 -0.112 -0.31 -0.51 -1.01 ... 1.01
I am no R regular but know some basics. Thank you in advance!