I am comparing files with same names in different folders which is easy if I just do it one by one. But how to compare multiple files in different folders with out doing it one by one. And write the output to an excel file in different sheets. such that abc-12.xlsx will contain 3 sheets where
sheet1= diff(~/my/path1/abc-12,~/my/path2/abc-12 )
sheet1= diff(~/my/path2/abc-12,~/my/path3/abc-12 )
sheet1= diff(~/my/path1/abc-12,~/my/path3/abc-12 )
I have files like below
Path:~/my/path1/
abc-12
abc-34
abc-45
abc-56
Path:~/my/path2/
abc-12
abc-45
Path:~/my/path3/
abc-12
abc-45
abc-56
#This is what I am trying
library(daff)
original <- list.files("~/my/path1/", ".tsv")
updated <- list.files("~/my/path2/", ".tsv")
edited <- list.files("~/my/path3/", ".tsv")
##Check if filename matches between two lists
check_updated <- basename(updated) %in% basename(original)
comp <- updated[check_updated]
if(comp == TRUE)
mapply(diff_data, original, updated)