0

I have a dataset with the following columns:

STORE_ID sales_value retail_disc Quantity
354 20 -0.2 2
354 3 0 7
120 45 0 1
580 3 -4 1
354 6 0 4
120 3 0 1
354 89 -2 7
580 3 0 1

I need to cluster the sales_value and retail_disc and quantity. After the clustering I need to get the corresponding store ID in each sample

Y.esk
  • 11
  • 3
  • 4
    It's easier to help if you provide [a reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with a small representative dataset in a plain text format, any code that you've tried and the desired output. The short answer to part of your question is that the R `kmeans()` function returns an object with a component named `cluster` which is the cluster ID of the data point. See `?kmeans` for help. – neilfws Mar 13 '23 at 23:36

0 Answers0