Re: [R] PCA analysis

From: Daniel Malter <>
Date: Tue, 17 Jun 2008 19:40:41 -0400

I am not entirely sure after reading your email, but I thought you wanted to do something like this:

###Start of example

###create random data for the example

x=rnorm(100,100,10)  ##create Xs
e=rnorm(100,0,5)     ##create Errors
y=x+e                ##create Ys

plot(y~x,pch=NA) ##plot Ys against Xs but suppress all symbols (i.e.
plot invisibly)
text(y~x,labels=round(x),pch=NULL) ##use values of X (rounded to its integer value) as symbols for the X-Y plot

###End of example

So you could just substitute your variable names for x and y in the plot() and text() commands. Let us know whether your problem is solved.


cuncta stricte discussurus

-----Ursprüngliche Nachricht-----
Von: [] Im Auftrag von Monna Nygård
Gesendet: Tuesday, June 17, 2008 5:04 AM An:
Betreff: [R] PCA analysis


I have a problem with making PCA plots that are readable. I would like to set different sympols instead of the numbers of my samples or their names, that I get plotted (xlabs). How is this possible? With points, i don4t seem to get the right data plotted onto the PCA plot, as I do not quite understand from where it is taken. I dont know how to plot the correct columns of the prcomp outcome (p).
I would really appreciate if someone could help me, I have struggled with
this for days now. How can I make a function that gives different symbols for the points, depending on how big the number given to it as xlabs is?  

Making the plots.  

read.table(file = "S:\\SEDIM\\TRFLP\\B90-700.txt",sep="\t", header=T)->boutbout <-bout[-1]p <- prcomp(bout) biplot(p, choices = c(2,3), scale = 1, pc.biplot = FALSE, var.axes = F, ylabs = NULL,

50","359","507","192","453","101","456","512","517"), cex=0.67, main="90-700bp")  

[[elided Hotmail spam]]


        [[alternative HTML version deleted]] mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Tue 17 Jun 2008 - 23:43:58 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 18 Jun 2008 - 00:31:05 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive