Hi all,
I realized what I was doing wrong and aplogize about posting before thinkg
about it for long enough. If I try to plot the pca results directly
(bulbil.pca), I can't do it. But if I extract the axes 1 and 2 and plot
directly, I can add col=as.numeric(group.bulbil[,3]) to the text() function
and it works the way I want it to work.
On Wed, Sep 10, 2008 at 1:23 PM, Wade Wall <wade.wall@gmail.com> wrote:
> Hi all,
>
> I have run a pca and want to plot the samples multivariate space using the
> sample numbers. In addition, I would like to color code the sample numbers
> by group, but can't find a way to color-code the sample numbers by
group.
>
> So, I have to do it in two separate steps:
>
> plot(bulbil.pca, col=as.numeric(group.bulbil[,3]),
> pch=as.numeric(group.bulbil[,3])) # group.bulbil[,3] is grouping
>
> plot(x_w,y_w,type="n")
> text(x_w,y_w,labels=group.bulbil[,1]) ##group.bulbil[,1] contains sample
> numbers
>
> Is there a way to plot the sample numbers and color-code them on one graph?
>
> Thanks for any help.
>
> Wade
>
[[alternative HTML version deleted]]