In r I'm trying to figure out how to find which areas are contained in A, B, C,D, etc. For instance, A contains 540, 300, 330. While C contains area 330.
I would like to save these to a vector so like A = [540,300,330] and C = [300], and D = [540, 330]
Data:
Area A B C D
540 Y Y
300 Y Y
330 Y Y
I was thinking of using a summaryBy Statement. But this doesn't give me the desired outcome.
summaryBy(Area ~ A, FUN=(length))