title: Report cell content of specific column for multiple rows in R
body: <p>I need to get R to output the "sample ID" of rows of my data frame (called "rats.df") containing missing values. I have so far been able to get the row numbers of the data frame containing missing values:</p>
  
  <pre><code>missing.val &lt;- unique( unlist( lapply (rats.df, function (x) 
                which (is.na (x)))))
  sort (missing.val, decreasing=FALSE)
  </code></pre>
  
  <p>Now I'm trying to output the value of the cell (in column 1 of the data frame) containing the sample ID of each of those rows, but the following commands just outputs all values in that column:</p>
  
  <pre><code>rats.df$sampleID [c(26,  38, 113, 127, 130, 152, 170, 176, 190, 232, 254, 257)]
  </code></pre>
  
  <p>I found this code on a different page, but because I don't understand all of it, I'm not able to apply it to my data frame. Well, I've tried, but somehow it doesn't give me the output I want:</p>
  
  <pre><code>index &lt;- which(rats.df==113, arr.ind=TRUE)
  paste(rownames(rats.df)[index[1]], colnames(rats.df)[index[1]], sep=", ")
  </code></pre>