counting things is generally fairly easy in R, so you should be hopeful.
How about making a reprex to start ?