compare some rows of a data frame

https://stackoverflow.com/questions/57847596/define-an-indicator-for-comparing-of-some-groups-member

A note on cross-posting: FAQ: Is it OK if I cross-post?