0

Thanks to look at this question! I make Redundancy analysis in R with vegan package using two data sets(one is microbial species, another is environment variables e.g pH DOC ...). Code showing:

mod<- rda(species~.,data=environment)
summary(mod)

Call:
rda(formula = species ~ Treatment + SR + DOC + NH4 + NO3 + AG + BG + CB + 
XYL + LAP + NAG + PHOS + PHOX + PEOX + pH + AP +MBC + MBN, data = 
environment) 
Partitioning of variance:
              Inertia Proportion
Total          644.87     1.0000
Constrained    560.18     0.8687
Unconstrained   84.69     0.1313

Eigenvalues, and their contribution to the variance 

Importance of components:
                           RDA1     RDA2    RDA3     RDA4     RDA5     RDA6    
RDA7
Eigenvalue            237.4215 126.5881 66.9355 31.62478 21.82210 18.56123 
9.04857
Proportion Explained    0.3682   0.1963  0.1038  0.04904  0.03384  0.02878 
0.01403
Cumulative Proportion   0.3682   0.5645  0.6683  0.71731  0.75115  0.77993 
0.79396 ...

and than i run the following code. it's normal.

anova.cca(mod)
Permutation test for rda under reduced model
Permutation: free
Number of permutations: 999

Model: rda(formula = species ~ Treatment + SR + DOC + NH4 + NO3 + AG + BG + 
CB + XYL + LAP + NAG + PHOS + PHOX + PEOX + pH + AP + MBC + MBN, data = 
environment)
         Df Variance      F Pr(>F)    
Model    21   560.18 7.2444  0.001 ***
Residual 23    84.69                  
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 

after above i run the following to know the significance of axis.

anova.cca(mod,by = "axis")

Error in terms.formula(formula, "Condition", data = data) : 
 'data' argument is of the wrong type  

i don't know what's happen, it confused me. I run the example:

data(dune)
data(dune.env)
dune.Manure <- rda(dune ~ ., dune.env)
anova.cca(dune.Manure,by='axis')

Permutation test for rda under reduced model
Forward tests for axes
Permutation: free
Number of permutations: 999

Model: rda(formula = dune ~ A1 + Moisture + Management + Use + Manure, data = dune.env)
          Df Variance      F Pr(>F)   
RDA1      1  22.3955 7.4946  0.003 **
RDA2      1  16.2076 5.4239  0.066 . 
RDA3      1   7.0389 2.3556  0.679   
RDA4      1   4.0380 1.3513  0.998   
....
Residual  7  20.9175                 

Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

this works.I compare the data with example and mine, and find no mistakes (i think). The question is the error in "anova.cca(mod,by = "axis")", why it occurred? . So how to deal this question.Thanks a lot!!!

Min.k
  • 1
  • 2
  • the question is the error in "anova.cca(mod,by = "axis")", why it occurred? – Min.k Apr 24 '18 at 03:56
  • I can't reproduce this with the dune example either; I thought it might be your use of `environment`, which is also a base R function, but everything works just fine for me there. Are you running the latest version of vegan 2.5-1? Is `environment` a data frame? You don't really give anyone much to go on here. – Gavin Simpson Apr 24 '18 at 15:19
  • I can get an error if I use old vegan (2.4-x series), but not with the current release version (2.5-1). What version of vegan do you use? – Jari Oksanen Apr 24 '18 at 18:15
  • Thank you to answer my question. the error was gone after data.matrix () and data.frame () my environment data. – Min.k Apr 27 '18 at 08:33

0 Answers0