I am trying to isolate entries in a dataframe which share common values: see below to reconstruct a portion of my df:
Stand<-c("MY","MY","MY","MY","MY")
Plot<-c(12,12,12,12,12)
StumpNumber<-c(1,2,3,3,7)
TreeNumber<-c(1,2,3,4,8)
sample<-data.frame(Stand,Plot,StumpNumber,TreeNumber)
sample
And get an output that tells me which entries have common values. In other words, to quickly isolate situations where there is more than one TreeNumber (or more than one row) for a given Stand,Plot,StumpNumber combination. In the example code that would be that StumpNumber 3 has TreeNumber 3 and TreeNumber 4.
My understanding of duplicated() is that can find instances where duplicated values occur within a single column- what can I do to find situations where a common combination of columns occurs?
Thanks.