[R-sig-eco] Error Between class analysis using bca() on BIOCLIM variables

THIOULOUSE JEAN Jean.Thioulouse at univ-lyon1.fr
Thu May 10 11:08:15 CEST 2012


Hi,

The input dataframe to the dudi.pca function is not correct. The pac.ade4 object is therefore bad, and the bca analysis complains about the number of axes (<=0). The scientific names (genus species) span on 2 separate columns, so using batrapair[,2:20] selects the species name as the first column of the data table. You should try to use batrapair[,3:20].

Jean

--
Jean Thioulouse
http://pbil.univ-lyon1.fr/JTHome/Biblio/



Le 10 mai 2012 à 00:09, Julian WITTISCHE a écrit :

> 
> 
> 
> 
> Dear all,
> I have tried to use the function bca() on PCA results (dudi.pca) :
> pca.ade4<-dudi.pca(batrapair[,2:20], center=T, scale=T, scannf=T); 2;
> betweenclass<-bca(pca.ade4,fac, scannf = TRUE);2;
> and I get this error:
> Error in if (nf <= 0) nf <- 2 : 
>  missing value where TRUE / FALSE is required
> 
> If you have any idea to solve this please let me know. I attached my script and here is what batrapair looks like
> 
>              SCIENTIFIC_NAME BIO_1 BIO_2 BIO_3 BIO_4...
> 15513 Batrachoseps incognitus   119   159    59  3844
> 15585 Batrachoseps incognitus   138   130    64  2449
> 15649 Batrachoseps incognitus   132   149    63  3093
> 15700 Batrachoseps incognitus   128   144    64  2872
> 15701 Batrachoseps incognitus   130   141    65  2719
> 19094      Batrachoseps minor   135   164    58  3954
> 19095      Batrachoseps minor   137   162    59  3791
> 19096      Batrachoseps minor   139   146    61  3147...
> Thank you very much,
> Julian
> 		 	   		  _______________________________________________
> R-sig-ecology mailing list
> R-sig-ecology at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology



More information about the R-sig-ecology mailing list