title: How to Use Loop in R to Count Frequency of an Occurrence?
body: <p>Essentially, I have a data set containing many people and a classification. A snippet:</p>
  <p><img src="https://i.stack.imgur.com/L5cOf.png" alt="Table 1" /></p>
  <p>I'd like to use a loop in R to iterate over the classification column to print out a frequency table which looks like this:</p>
  <p><img src="https://i.stack.imgur.com/GsHyj.png" alt="Table 2" /></p>
  <p>How could I do something like that? As an example for classification A: I'd like to loop through all 'A' classifications for an individual and then count the frequency that they appear for that person, which is printed in a new vector.</p>
  <p>Any help appreciated!</p>