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.
Error in as.data.frame(Lpcnm[[Chr]]$vectors[filter.na]) : object 'Lpcnm' not found
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 toscope
and there would be nowhere to go. Further argumenttest = "p"
is not allowed in modern vegan, becauseordistep
always uses permutation tests and duplicate usage gives an error.