title: rolling join two time series in data.table
body: <p>Suppose one has two asynchronous time-series in <code>data.table</code>:</p>
  <pre><code>dt1 = setkey(data.table(k = 2*(1:4) + 1, v = c(10, 15, 9, 7)), k)
  dt2 = setkey(data.table(k = 2*(1:3), v = c(11, 13, 6)), k)
  </code></pre>
  <p>My desired output is to merge them on <code>k</code> column using LOCF and all values of <code>k</code> from <code>dt1</code> and <code>dt2</code>, like so:</p>
  <pre><code>&gt; out
  k v i.v
  2 NA 11
  3 10 11
  4 10 13
  5 15 13
  6 15 6
  7 9  6
  9 7  6
  </code></pre>
  <p>Currently, I am using a somewhat clumsy construction:</p>
  <pre><code>all_keys = setkey(data.table(k = sort(c(dt1[, k], dt2[, k])), k)
  dt1[all_keys, roll = T, on = 'k'][
      dt2[all_keys, roll = T, on = 'k']]
  </code></pre>
  <p>This works, but feels a little contrived. Note that a simple rolling <code>dt1[dt2, roll = T]</code> or <code>dt2[dt1, roll = T]</code> would ignore keys from either <code>dt1</code> or <code>dt2</code>.
  Is there a simpler way?</p>
  <p>P.S. Side note - is there also a simpler way to create a keyed <code>data.table</code> from the beginning just using <code>data.table</code> function, without following up with a setkey?</p>