Not sure why the problem. I think I'd need see your actual data and give it a try. If you want to supply your data or a sample of it see ?dput for a convenient way to do so.
I see thought that you've found a dedicated ggplot biplot so if may not be worth your while. John Kane Kingston ON Canada > -----Original Message----- > From: a...@walla.co.il > Sent: Wed, 10 Jul 2013 12:49:55 -0700 (PDT) > To: r-help@r-project.org > Subject: Re: [R] PCA and gglot2 > > 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. > > ______________________________________________ > 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. ____________________________________________________________ GET FREE SMILEYS FOR YOUR IM & EMAIL - Learn more at http://www.inbox.com/smileys Works with AIM®, MSN® Messenger, Yahoo!® Messenger, ICQ®, Google Talk™ and most webmails ______________________________________________ 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.