title: Comparing two text files using R
body: <p>I am trying to compare two text files and list the differences in any log file, To achieve this I have used "diffr" library with below commands but the comparison results are being shown on R studios viewer console tab. Can anyone help me write better code to compare text files and list the differences?</p>
  
  <p>Also, what should I use if I want to compare files in a loop, as I am having multiple files saved for same query in different environment?</p>
  
  <p><strong>Code:</strong></p>
  
  <pre><code>library(diffr)
  
  setwd("C:/Users/squraishi/Desktop/OnDemand/R_ExtractDataSnapshot/Results")
  
  prod_file &lt;- read.csv2(file = "F_Query_Prod_7 .txt", header = TRUE, sep = "")
  beta_file &lt;- read.csv2(file = "F_Query_Beta_7 .txt", header = TRUE, sep = "")
  
  diffr("F_Query_Prod_7 .txt", "F_Query_Beta_7 .txt", contextSize = 0, minJumpSize = 500)
  </code></pre>