R: Dissolve shapes across attributes