title: Error in xy.coords dealing with NAs
body: <p>I'm getting the following error when I run the plot code: <code>Error in xy.coords(x, y, xlabel, ylabel, log) : 'x' and 'y' lengths differ</code>. I have many <code>NA</code>s in my data set which I understand is causing the problem. Any ideas as to:</p>
  
  <ol>
  <li>how to deal with NAs in R, and </li>
  <li>how to make sure I can plot plots of variables with differing lengths?</li>
  </ol>
  
  <p>I looked at some similar questions posted here, but unfortunately couldn't make sense of it. Needless to say, I'm new to R.</p>
  
  <pre><code> df &lt;- read.dta("r12.dta")
   attach(df)
   model1 &lt;- lm(rent~I(income^2)+income*races)
   fitted(model1)
   layout(matrix(1:4,2,2))
   plot(model1)
   plot(income, fitted(model1), xlab="Income", ylab="Rent",
        main="Fitted Values for Black  Rent",type="l")
  </code></pre>