title: Extending Suffixes in Merge to All Non-by Columns
body: <p><code>suffixes</code> in <code>merge</code> works only on common column names. Is there anyway to extend this to the rest of the columns as well without manually updating columns before the merge?</p>
  
  <p>That is -</p>
  
  <pre><code>df1 &lt;- data.table(
  a = c(1,2,3,4,5,6),
  b = c('a','b','f','e','r','h'),
  d = c('q','l','o','n','q','z')
  )
  
  df2 &lt;- data.table(
  a = c(1,2,3,4,5,6),
  d = c('q','l','o','n','q','z')
  )
  
  colnames(merge(df1,df2, by = 'a', suffixes = c("1","2")))
  #[1] "a"  "b"  "d1" "d2" what it does
  #[1] "a"  "b1" "d1" "d2" what I'd like it to do
  </code></pre>
  
  <p>The current way I'm handling this resembles @mrip's answer. </p>
  
  <pre><code>df1 &lt;- data.table(
  a = c(1,2,3,4,5,6),
  b = c('a','b','f','e','r','h'),
  r = c('a','b','f','e','r','h'),
  d = c('q','l','o','n','q','z')
  )
  
  df2 &lt;- data.table(
  a = c(1,2,3,4,5,6),
  c = c('a','b','f','e','r','h'),
  q = c('a','b','f','e','r','h'),
  d = c('q','l','o','n','q','z')
  )
  
  dfmerge &lt;- (merge(df1,df2, by = c("a"), suffixes = c("1","2")))
  
  setnames(
  dfmerge,
  setdiff(names(df1),names(df2)),
  paste0(setdiff(names(df1),names(df2)),"1")
  )
  
  setnames(
  dfmerge,
  setdiff(names(df2),names(df1)),
  paste0(setdiff(names(df2),names(df1)),"2")
  )
  
  colnames(dfmerge)
  #[1] "a"  "b1" "r1" "d1" "c2" "q2" "d2"
  </code></pre>