簡體   English   中英

線性判別分析圖

[英]Linear discriminant analysis plot

如何將樣本ID(行號)作為標簽添加到此LDA圖中的每個點?

library(MASS)
ldaobject <- lda(Species~., data=iris)
plot(ldaobject, panel = function(x, y, ...) points(x, y, ...),
     col = as.integer(iris$Species), pch = 20)

您可以在面板功能中使用text

library(MASS)
ldaobject <- lda(Species~., data=iris)
plot(ldaobject, 
     panel = function(x, y, ...) {
       points(x, y, ...)
       text(x,y,labels=seq_along(x),...) ## You change labels here 
      }
      ,
     col = as.integer(iris$Species), pch = 20)

在此輸入圖像描述

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM