[R] Recoding in R conditioned on a certain value.

2014-04-05 Thread Kate Ignatius
I'm trying to work out the average of a certain value by chromosome. I've done the following, but it doesn't seem to work: Say, I want to find average AD for chromosome 1 only and paste the value next to all the positions on chromosome 1: sam$mmad[sam$chrom == '1'] -

Re: [R] Recoding in R conditioned on a certain value.

2014-04-05 Thread David Winsemius
On Apr 5, 2014, at 9:51 AM, Kate Ignatius wrote: I'm trying to work out the average of a certain value by chromosome. I've done the following, but it doesn't seem to work: Say, I want to find average AD for chromosome 1 only and paste the value next to all the positions on chromosome 1: