Advertisement
Guest User

r

a guest
Jul 1st, 2015
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. library(ggbiplot)
  2. d<-read.table("pca_5_desc_bb_subset.tab", header=TRUE, sep="")
  3. d.class<-d[,6]
  4. d.pca <- prcomp(d[,1:5], center = TRUE, scale = TRUE)
  5. summary(d1.pca)
  6. plot(d.pca,type="lines")
  7. g <- ggbiplot(d.pca, obs.scale = 1, groups = d.class, ellipse = FALSE, circle = FALSE, varname.size = 0) + scale_color_discrete(name = '')
  8. + theme(legend.direction = 'vertical', legend.position = 'right', legend.text = element_text(size = rel(2)), legend.key.size = unit(2, "lines"), panel.background = element_rect(fill = 'white', colour = 'black'))
  9. print(g)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement