Hi everyone!
I'm going to analyze the attached data set, but I'm not able to add the
correct legend. In other words, I can't see which species is which.

http://r.789695.n4.nabble.com/file/n2994991/test_discriminant_anal_alle.xls
test_discriminant_anal_alle.xls 

This is my commands:

data<- read.table("clipboard",header=TRUE)
library(MASS)
output<-lda(Species~., data)
scores=predict(output, data)$x
plot(scores, col=rainbow(4)[data$Species], asp=1)

Is there a quick way to add a legend to the plot with the corresponding
colours?

It's probably an easy way to do it, but now I've used too many days on
this...

Thank you in advance, 

Arve L.
-- 
View this message in context: 
http://r.789695.n4.nabble.com/Adding-legend-to-lda-plot-using-the-MASS-package-tp2994991p2994991.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help@r-project.org mailing list
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 via email to