title: Select a row from a data frame with the least number of NA values
body: <p>So I have a block of text that I've seperated into a vector, and from each line of vector I've further seperated it into a data frame. In a perfect world, every row of the DF would be exactly the same, but it's not and there a number of rows with NA values in them. What I need to do is select the row from the data frame with the least number of NA values. </p>
  
  <p>So say the DF looked like this:</p>
  
  <blockquote>
    <p>Name Year NA Address NA State NA<br>
    Name Year ID Address City State Rank<br>
    Name Year NA NA       City State NA<br>
    Name NA NA NA NA NA Rank<br>
    Name Year NA NA NA NA NA</p>
  </blockquote>
  
  <p>Where they each belong to column. So I need a way to identify which row has the least number of NA's, and then select that row's elements. So ultimately I want the return to just be single row DF (or a vector preferably) that reads</p>
  
  <blockquote>
    <p>Name Year ID Address City State Rank  </p>
  </blockquote>
  
  <p>In this case, row 2. </p>
  
  <p>I know that:</p>
  
  <blockquote>
    <p>max( rowSums(!is.na(x)) ) </p>
  </blockquote>
  
  <p>Will return me the row# with the most number of not-na values, but I can't seem to figure out how to grab the elements of that row. I was thinking using which() would work, but I can't seem to figure it out.</p>
  
  <p>Thanks for your help!</p>
  
  <p>David</p>