I have .csv first file with three columns [well name, depth & grainsize] 76 samples , I have .csv second file with three columns [well name, depth & EC] 1797 samples, and I have .csv third file with three columns [well name, depth & CorrP] 1797 samples as well, I tried to write a code in R that make Grainsize as a reference and uses the 2nd column which is depth in m to match between EC file for instance and get the corresponding value from EC by comparing bot depth column number 2 for both files, unfortunately I am not able to do that because depth from Grainsize differ from depth from EC by little values this what I did in R
read original data
GrainSize_R3 <- read.csv("GrainSize_Well_R3.csv",header=TRUE)
EC_R3 <- read.csv("EC_Well_R3.csv",header=TRUE)
CorrP_R3 <- read.csv("CorrP_Well_R3.csv",header=TRUE)
merge(GrainSize_R3[,-1],EC_R3[,-1],all=TRUE)
I wonder if you can help in tweaking that script to allow +/- 0.1 difference in depth and the same thing for the 3rd file especially depth from it is the same depth column from EC as well
so, at the end I will have one file that has these columns well name, depth from the Grainsize, Grainsize, EC, and CorrP; if you are able to help me in that I will appreciate, then I can replicate that to all other 10 wells then merge them all, then run GAM model to fit all 462 samples, then, use this to predict Grainsize within each well individually.
Best Regards, Tamer Warshl
I added some jpg's for clarifications: enter image description here