clusplot() and fviz_cluster() functions

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

clusplot() and fviz_cluster() functions

Marco Besozzi
Can't understand why with clusplot() and fviz_cluster() functions I obtain
two x-axis mirror graphs. That's the code...


*mydata <- USArrests*













*z <- scale(mydata)## clustering MacQueen (k-means )#fit <- kmeans(z, 4,
algorithm = c("MacQueen"), nstart=50)#library(cluster)windows()clusplot(z,
fit$cluster, labels=3, lines=0, cex=0.6, col.txt="black",
col.p="black")#library(factoextra)windows()fviz_cluster(fit, data=z)#*

Thanks if someone has a suggestion!

---------------------------------------------------------------
Marco Besozzi, MD
---------------------------------------------------------------

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: clusplot() and fviz_cluster() functions

Sarah Goslee
The orientation of a principal components axis is entirely arbitrary,
and can vary with implementation. It doesn't matter at all.

Your code was hugely mangled by posting in HTML - see below.

Sarah

On Mon, Nov 4, 2019 at 12:33 PM Marco Besozzi <[hidden email]> wrote:

>
> Can't understand why with clusplot() and fviz_cluster() functions I obtain
> two x-axis mirror graphs. That's the code...
>
>
> *mydata <- USArrests*
>
>
>
>
>
>
>
>
>
>
>
>
>
> *z <- scale(mydata)## clustering MacQueen (k-means )#fit <- kmeans(z, 4,
> algorithm = c("MacQueen"), nstart=50)#library(cluster)windows()clusplot(z,
> fit$cluster, labels=3, lines=0, cex=0.6, col.txt="black",
> col.p="black")#library(factoextra)windows()fviz_cluster(fit, data=z)#*
>
> Thanks if someone has a suggestion!
>
> ---------------------------------------------------------------
> Marco Besozzi, MD
> ---------------------------------------------------------------
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



--
Sarah Goslee (she/her)
http://www.numberwright.com

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.