Looping and adding to a counter in R
问题 I have a dataframe df that contains a couple of columns, but the only relevant ones are given below. node | precedingWord ------------------------- A-bom de A-bom die A-bom de A-bom een A-bom n A-bom de acroniem het acroniem t acroniem het acroniem n acroniem een act de act het act die act dat act t act n I'd like to use these values to make a count of the precedingWords per node, but with subcategories. For instance: one column to add values to that is titled neuter , another non-neuter and