I have two data frames, one data frame has columns of four letter codes "ABCD, etc." that correspond to specific species codes, with the input value being how many of these species were present in a given plot observation.
The other data frame has these exact codes but as rows. However, one of the columns specifies a property (big, small, medium) of the species code.
My problem is I need to fig
ure out how many four letter codes that are "big" are in the first matrix.
So I need to somehow match the columns of one data frame with the rows of another, so I can know on average how many "big species" each plot had.
(see screenshot for a simplified example; the two data frames are much larger and have other columns as well)
I've been battling at this for awhile, trying to use merge, trying to use the pipe operator, etc. but can't seem to figure it out. There is probably some really elegant way, but I'm new to this. Any advice is much appreciated.
I understand your thinking here but I'm hoping to streamline it a little bit if possible. I have 67 Plots, and 100s of species, so manually entering everything would be very hard.
If your question's been answered (even by you!), would you mind choosing a solution? It helps other people see which questions still need help, or find solutions if they have similar problems. Here’s how to do it: