title: Learning R: foreach value in col-A, list unique values in Col-B and then associated values in Col C
body: <p>I'm learning R and have not coded in a long time (and no this is not a school assignment). My intent is to run NRC_Sentiment on notes, which I can do for only the 1st instance of the Cat. I've read doc on for loop and foreach loop (which I would've used in Perl).</p>
  <p>I have created a data frame from a csv file</p>
  <pre><code>Cat | Sub-Cat | Notes
  Cat1 | Apple | This is a fruit called apple and I love it
  Cat1 | Orange | This is a fruit called orange and I don't like it
  Cat2 | Tomato | This is a Veg called tomato and I like it
  Cat2 | Pepper | This a Veg called pepper and I don't like it
  Cat1 | Banana | This a fruit banana and I have no opinion about it
  </code></pre>
  <pre><code>dataIn = read.csv(...)[,1:3] #Read col 1,3
  df = data.frame(dataIn)
  uCat = data.frame(uCatR=c(df$Cat))
  uCat = unqiue(uCat)
  </code></pre>
  <p>I've tried for loop, but it stops at 1st instance of uCat, so any help is appreciated</p>
  <p>In perl I could create a hash of hashes and using foreach loop through each</p>