Re: [R-sig-eco] standard deviation error for EcoTest.sample

2019-01-11 Thread Jari Oksanen
No, you do not need to be worried about that warning. You have rarefaction up 
to the observed community, and that is always constant, hence you get the 
warning of zero standard deviation. That should be fixed, but I’m too lazy. 
Contributions welcome in vegan at https://github.com/vegandevs/vegan/.

cheers, Jari Oksanen

On 11 Jan 2019, at 20:09, Charlotte Reemts 
mailto:cree...@tnc.org>> wrote:

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  SiteTypesp1 sp2 sp3 sp4 sp5 sp6 sp7 sp8 sp9 
sp10sp11sp12sp13sp14sp15sp16sp17sp18sp19
sp20sp21sp22sp23sp24sp25sp26sp27sp28sp29
sp30sp31sp32sp33sp34sp35
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   alluvial1   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   alluvial1   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   alluvial1   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   alluvial1   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   alluvial1   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  alluvial1   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  alluvial1   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  alluvial1   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


[[alternative HTML version deleted]]

___
R-sig-ecology mailing list

[R-sig-eco] standard deviation error for EcoTest.sample

2019-01-11 Thread Charlotte Reemts
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  SiteTypesp1 sp2 sp3 sp4 sp5 sp6 sp7 sp8 sp9 
sp10sp11sp12sp13sp14sp15sp16sp17sp18sp19
sp20sp21sp22sp23sp24sp25sp26sp27sp28sp29
sp30sp31sp32sp33sp34sp35
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   alluvial1   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   alluvial1   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   alluvial1   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   alluvial1   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   alluvial1   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  alluvial1   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  alluvial1   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  alluvial1   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