I have tried to use the sample function after setting seed, and run the code in a Mac computer and windows 10 computer respectively. However, there are different results when using the sample function even setting seed.
For Example:
In Mac Computer:
> set.seed(1)
> sample(100,3)
[1] 68 39 1
In Windows Computer:
> set.seed(1)
> sample(100,3)
[1] 27 37 57
However, the rnorm function has worked properly:
> set.seed(2)
> rnorm(3)
[1] -0.8969145 0.1848492 1.5878453
Is there anybody facing the same problem? R version is 4.1.1.