Forming clusters/groups in a dataset based on unique values from some of the columns using R

Hello,

First of all: It is better practice to open a new topic if the original question has been answered (i.e., solution found).

Second, if you have a question, please provide a reprex where you at least show us your own attempts so we can work from there. A reprex consists of the minimal code and data needed to recreate the issue/question you're having. You can find instructions how to build and share one here:

I suggest you create a new issue and rephrase your question with the proper data and code (or at least your attempt) in form of a reprex.

Good luck!
PJ