Re: [R] PCA and gglot2

2013-07-11 Thread John Kane
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

[R] PCA and gglot2

2013-07-10 Thread ashz
Hi, I was trying as well as looking for an answer without success (a bit strange since it should be an easy problem) and therefore I will appreciate you help: My simple script is: # Loadings data of 5 columns and 100 rows of data data1-read.csv(C:/…/MyPCA.csv) pairs(data1[,1:4]) pca1 -

Re: [R] PCA and gglot2

2013-07-10 Thread John Kane
: a...@walla.co.il Sent: Wed, 10 Jul 2013 06:09:00 -0700 (PDT) To: r-help@r-project.org Subject: [R] PCA and gglot2 Hi, I was trying as well as looking for an answer without success (a bit strange since it should be an easy problem) and therefore I will appreciate you help: My simple script

Re: [R] PCA and gglot2

2013-07-10 Thread S Ellison
The biplot present the data points as numbers. How can I present the data point in color (depends on their group-column 5). I was thinking about doing it using ggplot2 but I can not succeed. Any idea how to do it? Perhaps the post at

Re: [R] PCA and gglot2

2013-07-10 Thread ashz
Hi, Thanks. Fig 4 in the link you provided is what I am looking for. I still do not know how to implement my data1 and pca1 in the script you provided as I think it is only a part of a full script. data1-read.csv(C:/…/MyPCA.csv) pca1 - princomp(data1[,1:4], score=TRUE, cor=TRUE) Am I right,

Re: [R] PCA and gglot2

2013-07-10 Thread John Kane
- From: a...@walla.co.il Sent: Wed, 10 Jul 2013 11:02:11 -0700 (PDT) To: r-help@r-project.org Subject: Re: [R] PCA and gglot2 Hi, Thanks. Fig 4 in the link you provided is what I am looking for. I still do not know how to implement my data1 and pca1 in the script you provided as I

Re: [R] PCA and gglot2

2013-07-10 Thread stephen sefick
the lines but I have not looked at it all that carefully. John Kane Kingston ON Canada -Original Message- From: a...@walla.co.il Sent: Wed, 10 Jul 2013 11:02:11 -0700 (PDT) To: r-help@r-project.org Subject: Re: [R] PCA and gglot2 Hi, Thanks. Fig 4 in the link you

Re: [R] PCA and gglot2

2013-07-10 Thread stephen sefick
the lines but I have not looked at it all that carefully. John Kane Kingston ON Canada -Original Message- From: a...@walla.co.il Sent: Wed, 10 Jul 2013 11:02:11 -0700 (PDT) To: r-help@r-project.org Subject: Re: [R] PCA and gglot2 Hi, Thanks. Fig 4 in the link you

Re: [R] PCA and gglot2

2013-07-10 Thread ashz
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,

Re: [R] PCA and gglot2

2013-07-10 Thread ashz
Hi, Thanks to ssefick for the ggbiplot tip. It works fine so I submit a general script thats works for future users. library(ggbiplot) data-read.csv(C:/…/MyPCA.csv) data1-data[,1:4] my.pca - prcomp(data1, scale. = TRUE) my.class- data$Group g - ggbiplot(my.pca, obs.scale = 1, var.scale =