All5TP<- read.table("C:/CLIM/Years5.txt",header=T) attach(All5TP) postscript(file="C:/CLIM/All5T.ps",height=12,width=16,horiz=F) par(mfrow=c(2,1),pty="s") #two square-sized plots quot<- "Temp. at 5 Stations A,B,H,K,P"; quot all5T<- cbind(TpA,TpB,TpH,TpK,TpP) txt<- c("A","B","H","K","P") "Correlation matrix"; cor(all5T) "Principal components" all5T.pca<- princomp(all5T,cor=T); summary(all5T.pca) load5T<- -loadings(all5T.pca) #minus sign for convenience print(load5T,cutoff=0.01) #print only loadings |.| > 0.01 x<- load5T[,1]; y<- load5T[,2] #Comp 1, Comp 2 (out of 5) plot(x,y,type="n",xlab="Comp. 1",ylab="Comp. 2") text(x,y,txt,cex=0.9); title(main=quot,cex=0.8) x<- -all5T.pca$scores[,1]; y<- -all5T.pca$scores[,2] #dim 79 plot(x,y,type="n",xlab="Factor Score 1",ylab="Factor Score 2") text(x,y,"1":"79",cex=0.75); title(main=quot,cex=0.8) dev.off() detach(All5TP) ## rm(list=objects()) ##