grouping partially multivariate data

Hi, welcome!

My undergraduate geology prof was fond of saying that a quaternary geologist was one who carried a shovel, mapped in at least seven shade of yellow and used the word "crap" indiscriminately.

Without a reproducible example, called a reprex, I can only offer general guidance, which is to look to K-nearest-neighbor or K-means clustering algorithms, which will attempt to minimize the n-dimensional distance between points. You might start with the knnn package. That package provides for weighting and will do far better than eyeballing what can be a messy process.

Come back with any follow-up questions, please.

(Disclosure: after graduate school, I had only a brief career in geology before wandering off the lithosphere into law.)