[R] Question about "sample" function and inconsistent results I am getting across machines.

Jeff Newmiller jdnewm|| @end|ng |rom dcn@d@v|@@c@@u@
Sun May 3 21:33:32 CEST 2020


It is a lot easier from this side of the conversation to view skeptically the claim that all of these installations of R are using the same version than that the software seed has started behaving randomly within the same version of R.

On May 2, 2020 10:39:58 PM PDT, "Fomby, Tom" <tfomby using mail.smu.edu> wrote:
>Please consider the following code:
>
>set.seed(1)
>
>train.index = sample(181,150)
>head(train.index)
># [1]  49  67 103 162  36 159  Result from my ASUS computer
>#
># [1]  68 167 129 162 43 14  Result from my wife's HP Pavilion computer
>
>In both cases, version 3.6.3 of R are being used.
>
>In addition, of the 20 students in my Predictive Analytics class, 14
>got the first result while 6 got the latter result.  These results do
>not seem to be specific to MAC (OS) versus PC (Windows).  In several
>cases, students using 3.6.3 got differing results.  This makes grading
>of homework challenging not knowing which partitions of the data are
>being used by the student.
>
>Thank you for considering my question.
>
>Sincerely,
>
>Tom Fomby
>
>Professor of Economics
>
>SMU
>
>Dallas, TX 75275
>
>tfomby using smu.edu
>
>
>	[[alternative HTML version deleted]]
>
>______________________________________________
>R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide
>http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.

-- 
Sent from my phone. Please excuse my brevity.



More information about the R-help mailing list