r - creating one new data frame applying one function over existing one -
i'm trying create new data frame using existing 1 data in pairs
targetid a1 a2 b1 b2 cg00000108 0.94483140 0.959417300 0.94427000 0.956393400 cg00000292 0.83331720 0.836168900 0.75568530 0.869691000 cg00001594 0.00000000 0.009319287 0.00318779 0.001852309 cg00003298 0.01775547 0.034981820 0.03380106 0.116663900 cg00003345 0.55442110 0.542106600 0.54762020 0.624028200 cg00004055 0.10287610 0.107147500 0.09293073 0.106663000
the idea 1 data frame results of subtraction between pairs,so getting finallythree final columns
targetid a1-a2 b1-b2
i tried apply have no enough programming skills in r how function begin subtraction
thanks in advance
how simply:
with(d, data.frame(targetid, a1-a2, b1-b2))
where d
data frame.
Comments
Post a Comment