I am using EcoTest.sample (rareNMtests package) to compare rarefaction curves 
for 19 vegetation plots on two soil types (alluvial and canyon). The code below 
produces the following warning (more than 50 times): "In cor(x > 0) : the 
standard deviation is zero".
The test still produces all the expected output. I tried sorting the dataset by 
SiteType, but still got the error. Curiously, sorting the data produced a 
significant difference between the site types (p around 0.3), while there was 
no difference between the unsorted data (p around 0.09).
Should I be concerned about the warnings? Why does sorting the dataset make a 
difference?

Thanks,
Charlotte

rawdata<-read.table(text="Plot  SiteType    sp1 sp2 sp3 sp4 sp5 sp6 sp7 sp8 sp9 
sp10    sp11    sp12    sp13    sp14    sp15    sp16    sp17    sp18    sp19    
sp20    sp21    sp22    sp23    sp24    sp25    sp26    sp27    sp28    sp29    
sp30    sp31    sp32    sp33    sp34    sp35
2   canyon  1   0   1   0   1   1   0   1   0   0   1   0   0   0   1   0   0   
0   0   0   1   0   0   0   0   0   0   0   0   0   1   0   1   0   0
3   alluvial    1   0   0   0   0   1   1   1   0   0   0   0   0   0   1   0   
0   1   0   0   0   0   0   0   0   0   0   0   0   1   0   0   1   0   0
5   alluvial    1   0   0   0   0   0   0   1   1   0   0   0   0   1   1   0   
0   1   0   0   0   0   0   0   0   1   0   0   0   0   0   0   1   0   0
6   alluvial    1   0   0   0   0   1   0   0   0   0   0   0   0   0   1   0   
0   0   1   0   1   1   0   0   0   1   0   0   0   0   0   0   1   0   0
7   alluvial    1   0   0   1   1   0   0   0   0   0   0   0   0   1   0   0   
0   0   0   0   0   0   0   0   0   1   0   0   0   0   0   0   1   0   0
8   alluvial    1   0   1   0   0   0   0   0   0   1   0   0   0   0   1   0   
0   0   0   1   0   1   0   0   0   0   0   0   0   0   1   0   1   0   0
10  alluvial    1   0   1   0   0   1   0   0   0   0   0   1   0   0   0   0   
0   0   1   0   0   1   0   0   0   0   0   0   1   0   1   1   1   0   0
11  canyon  1   1   0   0   0   1   0   0   0   0   0   0   0   1   1   0   0   
0   0   0   1   0   1   0   0   0   1   0   1   0   0   0   1   0   0
12  canyon  0   0   0   0   0   0   0   0   0   0   0   0   0   1   0   0   0   
0   0   0   0   1   0   0   0   0   0   0   0   0   0   0   0   0   0
13  canyon  1   0   0   0   0   1   0   0   0   0   0   0   0   0   1   0   0   
0   0   0   1   0   0   1   0   0   0   0   0   1   0   0   0   0   0
14  canyon  1   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   
0   0   0   0   1   0   0   0   0   0   0   0   0   0   0   0   0   0
15  canyon  1   0   0   0   0   1   0   0   0   0   0   0   0   0   0   0   0   
0   0   0   1   0   0   0   0   0   0   0   1   1   0   0   0   0   0
16  canyon  1   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   
0   0   0   0   1   0   0   0   0   0   0   0   0   0   0   0   0   0
17  canyon  1   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   
0   0   0   0   1   0   0   1   0   0   0   0   0   0   0   0   0   0
18  canyon  1   0   0   0   0   0   0   0   0   0   0   0   0   0   1   1   1   
0   0   0   0   0   0   0   0   0   0   0   0   1   0   0   1   0   0
19  canyon  1   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   
0   0   0   0   1   0   1   0   0   0   0   0   0   0   0   0   1   0
20  canyon  1   0   0   0   0   1   0   0   0   0   0   0   0   1   1   0   0   
0   0   0   0   1   0   0   0   0   0   0   0   0   1   0   0   0   1
22  alluvial    1   0   0   0   0   1   0   0   0   1   0   0   1   0   1   0   
0   0   0   0   0   1   0   1   1   0   0   1   0   1   0   0   1   0   0
23  alluvial    1   0   0   0   0   0   0   0   0   0   0   0   1   0   0   0   
0   0   1   0   0   1   0   0   1   0   0   0   0   0   1   0   0   0   0
", header=T)

data<-rawdata[,-1]
rownames(data)<-rawdata[,1]

library(rareNMtests)
test.data<-EcoTest.sample(data[,-1], by=data$SiteType, MARGIN=1, trace=F)  
#error message and no significant difference

data2<- data[do.call(order, data),]
test.data2<-EcoTest.sample(data2[,-1], by=data2$SiteType, MARGIN=1, trace=F)  
#error message and significant difference



        [[alternative HTML version deleted]]

_______________________________________________
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology

Reply via email to