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.