[R] Changing the label name in the plot
@ubh@m|tr@@p@tr@ @end|ng |rom gm@||@com
Tue Jun 11 06:43:13 CEST 2019
I am doing cluster analysis, but when I am plotting the results, the no. of
observation is coming as the level. Hence, I have a different level name
for each observation differently for each column. I have 2 columns, namely
DMs, and EMs, which will be clustered, but I am unable to label each dot in
the cluster as per their different name. In other words, the dots in the
cluster are being labeled as per their number of observation which I want
to rename as per their different name in the data. But, sometimes in code,
both the columns indicating the cluster names are not supporting due to
their non-numerical texts.
Hence, my query is how to rename or change the label of each dot in a
cluster. Here is my code.
k2 <- kmeans(ts, centers = 2, nstart = 25)
fviz_cluster(k2, data = ts)
Here, I have 2 columns i.e. DMs, and EMs with their different label name
(i.e. the different name for different observation differently for 2
columns), and want to plot such label name in the cluster graph rather than
the no. of observation.
For your convenience, I am attaching my data.
Please find the attached data, and kindly help me in this regard.
*Phd. Research Scholar*
*Department of Humanities and Social Sciences*
*Indian Institute of Technology, Kharagpur*
More information about the R-help