I have two lists (first one is data, second one is background) of files that are composed of X and Y coordinates. X coordinates are the same for both lists. I would like to subtract the y coordinates of corresponding files (A1-A2, B1-B2, etc) for whole data set. Is there a quick way to do it? data1 is composed of {a1.txt, a2.txt} and data2 of{b1.txt,b2.txt}
I can only imagine doing a small for loop in which I use following code:
data1[[1]][[All, 2]] - data2[[1]][[All, 2]]
and then I MapThread
X
and new Y
coordinate. data1[[1]]
X Y1
0.008362 837448.1111
0.028126 23665.24245
0.048397 2174.605716
0.068667 528.9201242
0.088938 205.8876254
0.109208 98.85484604
0.129477 65.01622775
0.149746 43.40275276
0.170015 35.06444229
0.190282 25.51391261
0.200416 21.10450766
data2[[1]]
X Y4
0.008362 0.008166246
0.028126 0.02746757
0.048397 0.047264026
0.068667 0.067059506
0.088938 0.086855961
0.109208 0.106651441
0.129477 0.126445943
0.149746 0.146240446
0.170015 0.166034949
0.190282 0.185827498
0.200416 0.195724261
https://www.dropbox.com/sh/gh4ud83lrgfa3jo/AADFIaofouq9X9OUJmeaQ0cna?dl=0
Comments
Post a Comment