title: How to highlight the common rows from 2 separate dataframes in R?
body: <p>I have 2 dataframes and I would like to highlight the common rows</p>
  <pre><code>library(openxlsx)
  
  df = data.frame(Year = c(2018,2019,2020,2018,2019,2020,2018,2019,2020),
                  Country = c(&quot;Germany&quot;,&quot;Germany&quot;,&quot;Germany&quot;, &quot;Japan&quot;, &quot;Japan&quot;, &quot;Japan&quot;,  &quot;Thailand&quot;, &quot;Thailand&quot;, &quot;Thailand&quot;), 
                  Count = c(17, 15, 60, 23, 25, 60, 50, 18, 31))
  
  
  df2 = data.frame(Year = c(2018,2019,2020,2018,2019,2020,2018,2019,2020),
                  Country = c(&quot;Germany&quot;,&quot;Germany&quot;,&quot;Germany&quot;, &quot;Japan&quot;, &quot;Japan&quot;, &quot;Japan&quot;,  &quot;Japan&quot;, &quot;Thailand&quot;, &quot;Thailand&quot;), 
                  Count = c(17, 100, 101, 102, 103, 60, 104, 18, 31))
  
  
  wb = createWorkbook()
  addWorksheet(wb, &quot;Master&quot;)
  writeDataTable(wb, &quot;Master&quot;, df2, tableStyle = &quot;TableStyleLight9&quot;)
  yellow_style = createStyle(fgFill = &quot;#FFFF00&quot;)
  x = which(abs(df2$Count) == df$Count)
  y = 1:which(colnames(df2) == &quot;Count&quot;)
  addStyle(wb, sheet = &quot;Master&quot;, style = yellow_style, rows = x+1, col = y, gridExpand = TRUE)
  saveWorkbook(wb, &quot;Master.xlsx&quot;, overwrite = TRUE)
  </code></pre>
  <p>Right now this set of codes work but it can only verify &quot;Count&quot; instead of the entire row.
  If I want to find out the common &quot;Count&quot;, it will work perfectly. But let's say I want to verify that the entire row is the same, how do I do it?</p>