title: Using data.table::setnames() when some column names might not be present
body: <p>I have a script returning a <code>data.table</code> which will contain a set of columns. I'd like to rename some of these columns, but <code>setnames</code> breaks if not all are present. Is there any way to rename without looping+error catching or intersecting against existing names?</p>
  
  <pre><code>iris.dt &lt;- data.table(iris)
  # First time works fine
  setnames(iris.dt, c("Sepal.Length", "Sepal.Width"), c("length", "width"))
  # Second time fails because columns no longer exist
  setnames(iris.dt, c("Sepal.Length", "Sepal.Width"), c("length", "width"))
  # Error in setnames(iris.dt, c("Sepal.Length", "Sepal.Width"), c("length",
  # :Items of 'old' not found in column names: Sepal.Length,Sepal.Width
  </code></pre>
  
  <p>Something like <code>setnames(..., allow=T)</code> would be ideal.</p>
  
  <p><strong>Edit</strong>: Filed this as a <a href="https://github.com/Rdatatable/data.table/issues/1099" rel="noreferrer">FR on Github</a>.</p>