1 min readJun 1, 2018
Hi Mohamed, checked it out.
You’re right, the part of the code was missing: synthetic.customers.cl is the original dataframe + a column with clusters assigned.
Just add this before the code block, should fix it:
clust.num <- cutree(aggl.clust.c, k = 7)
synthetic.customers.cl <- cbind(synthetic.customers, clust.num)
Tell me if it works!