title: Count number of Variables Missing per Value in Column
body: <p>I currently have a csv that is loaded as a dataframe into R with 2500 observations and 49 columns. The data looks like the following:</p>
  
  <pre><code>    Donor Year Amount
  World Bank 2006 94,000
  World Bank 2007 
  World Bank      80,000
  </code></pre>
  
  <p>I am trying to get a count of all the missing values in the csv by donor (which is a column) and then divide it by the total observations to get the ratio of missing data per donor.</p>
  
  <p>For the above example, which has 2 missing fields and 9 total fields, the math would look something like this:</p>
  
  <p>2NA/9total fields.</p>
  
  <pre><code>donor_empty_iati&lt;- group_by(chad_iati, reporting.org)
  summary_donor_empty_iati &lt;- summarise(donor_empty_iati, count_empty = length(which(n==""|n==" ")), total_by_donor = count_empty/nrow*49)
  
  order_summary_donor_empty_iati &lt;- summary_donor_empty_iati[order(-summary_donor_empty_iati$total_by_donor),]
  </code></pre>
  
  <p>Any help to quickly do this using a summarize or function would be really helpful.</p>