etc/cancer.R

data(nci,package="ElemStatLearn")
library(MASS)
LDA <- lda(t(nci),colnames(nci))
dirs <- t(nci) %*% LDA$scaling[,1:2]
df <- data.frame(dirs,type=rownames(dirs),row.names=NULL)
library(ggplot2)
ggplot(df,aes(LD1,LD2))+
  geom_text(aes(label=type,colour=type))
## better to just direct label every point than to use directlabels

Try the directlabels package in your browser

Any scripts or data that you put into this service are public.

directlabels documentation built on May 2, 2019, 6:13 p.m.