[R] PCA and gglot2

ashz ashz at walla.co.il
Wed Jul 10 21:49:55 CEST 2013


Dear John,

Thanks for the help.

I did some minor modifications to your script as I had some problems:
... 
pca = PCA(data[,1:4], scale.unit=T, graph=F)
dat1  <-  data.frame(pca$scores)  # creates the data.frame
dat1$items  <-  rownames(data$group) # adds item names
ggplot(dat1, aes(pca$ind$coord[,1], pca$ind$coord[,2], colour = dat1$item))
+ geom_point() + theme(legend.position="none")

I still do not get separation by color by group (column 5 of csv file) as
the  dat1 is empty (data frame with 0 columns and 0 rows).

Any reason why?

Thanks again.



--
View this message in context: http://r.789695.n4.nabble.com/PCA-and-gglot2-tp4671225p4671253.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list