title: R function prcomp fails with NA's values even though NA's are allowed
body: <p>I am using the function <code>prcomp</code> to calculate the first two principal components. However, my data has some NA values and therefore the function throws an error. The na.action defined seems not to work even though it is mentioned in the help file <code>?prcomp</code></p>
  
  <p>Here is my example:</p>
  
  <pre><code>d &lt;- data.frame(V1 = sample(1:100, 10), V2 = sample(1:100, 10))
  
  prcomp(d, center = TRUE, scale = TRUE, na.action = na.omit)
  
  d$V1[5] &lt;- NA
  d$V2[7] &lt;- NA
  
  prcomp(d, center = TRUE, scale = TRUE, na.action = na.omit)
  </code></pre>
  
  <p>I am using the newest R version 2.15.1 for Mac OS X.</p>
  
  <p>Can anybody see the reason while <code>prcomp</code> fails?</p>
  
  <p>Here is my new example:</p>
  
  <pre><code>d &lt;- data.frame(V1 = sample(1:100, 10), V2 = sample(1:100, 10))
  
  result &lt;- prcomp(d, center = TRUE, scale = TRUE, na.action = na.omit)
  
  result$x
  
  d$V1[5] &lt;- NA
  
  result &lt;- prcomp(~V1+V2, data=d, center = TRUE, scale = TRUE, na.action = na.omit)
  
  result$x
  </code></pre>
  
  <p>is it possible to retain row 5 in PC1 and PC2? In my real data set I have of course more than two columns of variables and only some of them are missing and I do not want to lose the remaining information hidden in the other values!</p>