0

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.

mestaki
  • 49
  • 4

1 Answers1

1

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().

Jari Oksanen
  • 3,287
  • 1
  • 11
  • 15
  • Thank you Dr. Oksanen. I believe my error was that I assumed setting the seed at the beginning of the script would remain the same for the duration of the session. The issue above only happened when I ran only the ordistep line repeatedly. Once I started setting the seed each time I ran ordistep the results came back the same. Thanks again! – mestaki May 23 '15 at 06:42