In R, find whether two files differ

前端 未结 5 1051
春和景丽
春和景丽 2021-01-04 07:50

I would like a pure R way to test whether two arbitrary files are different. So, the equivalent to diff -q in Unix, but should work on Windows and without exter

5条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-04 08:33

    Without using memory, if the files are too large:

    library(tools)
    md5sum("file_1.txt") == md5sum("file_2.txt")
    

提交回复
热议问题