rrandom-seedveganrda

Reproducing results from Ordistep


Relatively new to R and first time posting so my apologies if there is something missing in my question. I'm using Vegan's ordistep function for variable selection using the default "both" direction method. I'm using a Hellinger transformed Species Abundance data frame as response variables and a 12 column independent variables data frame. I seem to get different inclusion variables if I run the same code (below) multiple times. I'm assuming there is a pseudo number generator involved that set.seed can't constrain. Is there a way to reproduce consistent results?

set.seed(2000)
step.both <- ordistep(pre_met.rda, pstep=1000)

Thank you.


Solution

  • ordistep uses standard R RNG and honours set.seed(). I can't reproduce your problem, but I get exactly the same results when I set seed to the same value before call.

    Current version of ordistep has no pstep argument. Although we now have a new implementation, we have always honoured R set.seed().