I'm fairly new to R (taking it as a grad student) and I'm unsure how to combine and sum specific data.
So right now my data looks like this
What I would like to do is look only at the site and each type of earthworm (Juv, Epi, Endo, Ane, Unk). And I want to group all of the site samples into one big site. So for ex. I want all my site 5 to combine together and show the sum of all the earthworms in each type of earthworm (Juvs, Epis, Endo...etc.), do this for site 27 and all my other sites.
So I'm hoping the end result would be something like
| Site | Juv | Epi |.........
| ---- | --- | --- |.........
| 5 | 15 | 2 |.........
| 27 | 6 | 0 |.........
I hope this all makes sense. Let me know if there's anymore information needed!!
My professor mentioned tapply function but we havent covered this is class and I don't understand how to apply this to my data