title: Prevent NA from being used in a lm regresion
body: <p>I have a vector Y containing future returns and a vector X contain current returns. The last Y element is NA, as the last current return is also the very end of the available series.</p>
  
  <pre><code>X = { 0.1, 0.3, 0.2, 0.5 }
  Y = { 0.3, 0.2, 0.5, NA }
  Other = { 5500, 222, 523, 3677 }
  
  lm(Y ~ X + Other)
  </code></pre>
  
  <p>I want to make sure that the last element of each series is <strong>not</strong> included in the regression. I read the na.action documentation but I'm not clear if this is the default behaviour.</p>
  
  <p>For cor(), is this the correct solution to exclude X[4] and Y[4] from the calculation?</p>
  
  <pre><code>cor(X, Y, use = "pairwise.complete.obs")
  </code></pre>