[R] problem with plotting clustered data with convex hull using ggfortify

Karl Schilling k@r|@@ch||||ng @end|ng |rom un|-bonn@de
Sun Oct 24 22:57:26 CEST 2021


Dear all:

I have some data that I want to cluster and display as groups surrounded 
by convex hulls. Here, i use the iris data as an example:

library(ggfortify)
autoplot(fanny(iris[-5], 3), frame = TRUE)

I used this code before, about a year ago, and then it resulted in data 
surrounded by convex hulls., just as may be seen in the description of 
ggfortify here:


http://rstudio-pubs-static.s3.amazonaws.com/53162_cd16ee63c24747459ccd180f69f07810.html


Presently, no hulls are drawn; instead some line is projected on each 
cluster.

I found out that there is an addition to autoplot command, "frame.type = 
c("convex", "norm", "t"). Whereas ""norm" and "t"  give confidence 
ellipses as expected, "convex" results in a straight line as mentioned 
above.

Any help would be appreciated.

Best

-- 
Karl Schilling



More information about the R-help mailing list