[R] Performing multiplication on duplicate values
jorgemdinis at gmail.com
Mon Oct 29 17:27:19 CET 2012
Hello all, thank you for your help. The task I need to perform is difficult
to explain so I apologize a head of time for any confusion.
I have a data frame with these colnames() Reference_Position,
Reference_Allele, Variant_Allele, Variant_Frequency, AAC_Variant. If a
value is duplicated in the "Reference_Position" column, I would both of
their "Variant_Frequency" values multiplied and inserted into a new data
example below: reference position 64 is repeated, multiple 94.155381 by
92.947658 and insert value into "Value".
Because I do not know how to best explain this or phrase it into a logical
questions, here is a before and after. Also, if you could explain the code a
bit, that would be appreciated as well- teach and person to fish!
[Reference_Position] [Reference_Allele] [Variant_Allele] [Variant_Frequency]
16 G A 91.833811
52 G A 93.969466
64 G T 94.155381
73 C A 94.293478
131 G A 94.268168
64 G A 92.947658
[Reference_Position] [Variant_Frequency] [Value]
73 94.293478 NA
131 94.268168 NA
View this message in context: http://r.789695.n4.nabble.com/Performing-multiplication-on-duplicate-values-tp4647772.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help