简体   繁体   English

fviz_cluster 图中的值与数据集的数据点不对应

[英]The values in a fviz_cluster figure do not correspond with the datapoints of the dataset

I have composed the following script for a clustered scatter plot with fviz_cluster.我已经为带有 fviz_cluster 的集群散布 plot 编写了以下脚本。 According to the plot, there are negative values for x and negative values for y.根据 plot,x 有负值,y 有负值。

dots <- dots %>%
  select(GRNHLin, RED2HLin)
    
dots <- dots %>%
  filter(RED2HLin >= 1.0)

dots.Mclust <- Mclust(dots, modelNames="VVV", G=8)
#BIC <- mclustBIC(dots)
#ICL <- mclustICL(dots)
#summary(BIC)
#summary(ICL)

visual <- fviz_cluster(dots.Mclust, 
             ellipse=FALSE,
             data=dots.Mclust["GRNHLin", "RED2HLin"],
             shape=20, 
             ellipse.alpha = 0.1,
             alpha=0.450, 
             geom = c("point"),
             show.clust.cent = FALSE,
             main = FALSE,
             legend = c("right"),
             palette = "npg",
             legend.title = "Clusters") +
  labs(x="Green Fluorescence Intensity", y="Red Fluorescence Intensity")
  #scale_x_continuous(#breaks = trans_breaks("log10", function(x) 10^x),
                #labels = trans_format("log10", math_format(10^.x)),
                #limits = c(0,6)) +
  #scale_y_continuous(#breaks = trans_breaks("log10", function(x) 10^x),
                #labels = trans_format("log10", math_format(10^.x)), 
                #limits = c(-7,6))
visual
head(dots.Mclust)

聚集散点图(注意左侧和 0 以下的值)。

According to head(dots.Mclust) (and my thorough analysis) there are no negative values.根据 head(dots.Mclust) (以及我的彻底分析),没有负值。

$data
           GRNHLin    RED2HLin
   [1,]   81.50364  176.379654
   [2,]   57.94751  116.310577
   [3,]   42.89310  119.758621
   [4,]   41.82213  275.607971
   [5,]  437.14648  141.309647
   [6,]   15.20952  177.128616
   [7,]   18.88731  257.249207
   [8,]  768.64935  172.374069
   [9,]   24.66220  118.283150
  [10,]   17.12160   68.955154
  [11,]   73.00019   71.517052
  [12,] 1182.08911  180.694122

Where does this discrepancy come from?这种差异从何而来? How is fviz(cluster) changing the values on the plot? fviz(cluster) 如何更改 plot 上的值? Did some normalisation or scaling take place?是否进行了一些标准化或缩放?

I had this same issue and what fixed it was adding stand=F to you fviz_cluster() options.我遇到了同样的问题,解决方法是在fviz_cluster()选项中添加stand=F In the documentation this:在文档中:

stand
logical value; if TRUE, data is standardized before principal component analysis

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM