title: Count of Comma separated values in r
body: <p>I have a column named <i>subcat_id</i> in which the values are stored as comma separated lists.  I need to count the number of values and store the counts in a new column.  The lists also have Null values that I want to get rid of.</p>
  
  <p><a href="https://i.stack.imgur.com/kM9XO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kM9XO.png" alt="Example"></a></p>
  
  <p>I would like to store the counts in the <em>n</em> column.</p>