geo_results <- read.csv (here:: here ("./notebooks/Geochemistry analysis - Copy 2.csv" )) %>%
pivot_longer (cols = Ag: Zr, names_to = "Fingerprint" , values_to = "value" ) %>%
filter (Fingerprint %in% c ("Ag" , "Al" , "As" ,"B" ,"Ba" ,"Be" ,"Bi" ,"Ca" ,"Cd" ,"Ce" ,"Co" , "Cr" , "Cs" , "Cu" , "Fe" , "Ga" , "Hf" , "Hg" , "In" , "K" , "La" , "Li" , "Mg" , "Mn" , "Mo" , "Nb" , "Ni" , "P" , "Pb" , "Rb" , "S" , "Sb" , "Sc" , "Se" , "Sn" , "Sr" , "Te" , "Th" , "Tl" , "U" , "V" , "Y" , "Zn" , "Zr" )) %>% # excludes fingerprints that are below level of detection
dplyr:: select (- X) %>% # don't need this column
filter (sample_design %in% c ("Grid" , "Transect" , "Likely to erode" ))
col_results <- read.csv (here:: here ("./notebooks/final results revised.csv" )) %>%
pivot_longer (cols = X: B, names_to = "Fingerprint" , values_to = "value" ) %>%
dplyr:: select (- X.1 ) %>% # don't need this column
filter (sample_design %in% c ("Grid" , "Transect" , "Likely to erode" )) %>%
mutate (Fingerprint = paste0 (Fingerprint, "_col" )) # appended _col as some of the colour coefficients have the same id eg Boron = B and Blue also = B
# Bind data sets
results <- geo_results %>%
bind_rows (col_results) %>%
filter (Fingerprint %in% fingerprints)