0

I have been running the ordistep function on the results of an RDA on a species abundance matrix and a large number of PCNMs.

here is the code I have been using. Chr is a numerical vector from 1:23 to loop through different experiments, and filter.na removes some plots that we are missing data from.

  R <- rda(Gbos[[Chr]][filter.na,]~., as.data.frame(Lpcnm[[Chr]]$vectors[filter.na]))
  step.forward[[i]] <- ordistep(R, scope = formula(R), test="p")

My issue is that I have from 80-120 PCNMs in the formula, and I need to find a more minimal model. However, whenever I have more than 57 PCNMs a couple of steps I get an error saying:

Error in Condition(PCNM1 + PCNM2 + PCNM3 + PCNM4 + PCNM5 + PCNM6 + PCNM7 + : could not find function "Condition" Calls: step ... ordiParseFormula -> model.frame -> model.frame.default -> eval -> eval Execution halted

am I missing something obvious? the function seems to work fine if I have less than 57 PCNMs.

Brent
  • 1
  • I cannot reproduce this, but I get an error `Error in as.data.frame(Lpcnm[[Chr]]$vectors[filter.na]) : object 'Lpcnm' not found` – Jari Oksanen Mar 13 '18 at 11:38
  • My personal problem is that I cannot reproduce this. I had a look at this a couple of days ago, and I believed I understood what should be changed in **vegan**. To do this, I needed a test case to see that the planned fix works. I have tried to trigger the error with various tricks today, but all in vain: **vegan** just works and gives no error. This also means that I won't start implementing the scheduled fix, because I do not know what to fix and I can't check that the fix works. For a starter, it would be useful to know what are the versions of **R** and **vegan** that you use. – Jari Oksanen Mar 17 '18 at 12:42
  • Some further comments: the `ordistep()` command in your example would not work at all in modern **vegan** (or, I think, in any **vegan**): your starting model (`R`) is equal to `scope` and there would be nowhere to go. Further argument `test = "p"` is not allowed in modern **vegan**, because `ordistep` always uses permutation tests and duplicate usage gives an error. – Jari Oksanen Mar 17 '18 at 12:45

1 Answers1

0

This really seems to a bug in vegan. It is now fixed in github. Meanwhile you can get around the problem issuing

Condition <- I

before ordistep. (This is a lowly kluge: do not try to understand why to do so, but it seems to work.)

Jari Oksanen
  • 3,287
  • 1
  • 11
  • 15