
Dear all,
I have a problem to plot a convex hulls on PCA results. The PCA has reduced the 19 BIOCLIM variables to two axes and I want to plot a convex hull to be able to illustrate the environmental space overlap of two species. 
This is my script:
library(Hmisc);library(ade4);
#Import data
batrabio<-read.table(file="Bioclimfull.txt", sep="\t", header=TRUE);batrabio<-batrabio[,c(1,4:22)];  #To select only species name and the 19 bioclim variables columns      batrapair<-batrabio[batrabio$SCIENTIFIC_NAME=="Batrachoseps minor"|  batrabio$SCIENTIFIC_NAME=="Batrachoseps incognitus",]; #To select two species to compare and illustrate their environmental space
batrapair<-unique(batrapair[,]);#To select only unique localities
#Run PCAs based on columns with climate data
pca.ade4<-dudi.pca(batrapair[,2:20], center=T, scale=T, scannf=T); 2;#number of axes
#Create convex hull using PCA axes, and colour-code points according to species name
convex.hull<-s.chull(pca.ade4$li,as.factor(batrapair$SCIENTIFIC_NAME),add.plot=F, grid=F, clabel=0, origin=c(0,0),addaxes=T,col=c("red","blue"), cpoint=.65) 

I get the axes, the grid, the species name label but nothing else. I would greatly appreciate any advice as I have not been able to figure myself how to solve this problem.
Thank you very much,
Julian 

 		 	   		  
	[[alternative HTML version deleted]]

