title: Count the number of non-zero elements of each column
body: <p>Very new to R and I have a .rda file that contains a matrix of gene IDs and counts for each ID in 96 columns. It looks like this:</p>
  
  <p><img src="https://i.stack.imgur.com/x8kGI.png" alt="enter image description here"></p>
  
  <p>I want to get separate counts for the number of non-zero items in each column. I've been trying the sum() function in a loop, but perhaps I don't understand loop syntax in R. Any help appreciated.
  Thanks!</p>
  
  <p>Forest</p>