Tutorial by Examples

The sample command can be used to simulate classic probability problems like drawing from an urn with and without replacement, or creating random permutations. Note that throughout this example, set.seed is used to ensure that the example code is reproducible. However, sample will work without expl...
The set.seed function is used to set the random seed for all randomization functions. If you are using R to create a randomization that you want to be able to reproduce, you should use set.seed first. set.seed(1643) samp1 <- sample(x = 1:5,size = 200,replace = TRUE) set.seed(1643) samp2 &lt...

Page 1 of 1