[R] Plotting principle components against individual variables

Brett Stansfield brett at hbrc.govt.nz
Sat Apr 9 03:49:46 CEST 2005


Dear R

I am trying to plot some Principle component scores against the individual
variables that made the first biplot.
First I need to identify some points in the plot as follows
running2 <- running[c("USA", "New Zealand", "Dominican Republic", "Western
Samoa", "Cook Islands"),]

this works fine,
I then ask to do a plot

plot(running$X100m, running.pca$scores[,1])

this works fine also

I then need to specify points to highlight the countries of running2
And this is where I get stuck

points(running2$X100m, running.pca$scores, col="red")
Error in xy.coords(x, y) : x and y lengths differ

What am I doing wrong here

Brett Stansfield




More information about the R-help mailing list