Reputation: 332
When the run the below code, the random numbers are different everytime I run this. Is there a way to fix this? I mean the random number should be same all time
sample(1:10)
Upvotes: 0
Views: 33
Reputation: 29417
Use set.seed method
set.seed
set.seed(666) sample(1:10)
Upvotes: 1