Access scores for observation on linear discriminants in LDA using MASS:lda()
问题 library(MASS) example(lda) plot(z) How can I access all the points in z? I want to know the values of every point along LD1 and LD2 depending on their Sp (c,s,v). 回答1: What you are looking for is computed as part of the predict() method of objects of class "lda" (see ?predict.lda ). It is returned as component x of the object produced by predict(z) : ## follow example from ?lda Iris <- data.frame(rbind(iris3[,,1], iris3[,,2], iris3[,,3]), Sp = rep(c("s","c","v"), rep(50,3))) set.seed(1) ##