Creating a random sequence using sample() in R
It is not uncommon to generate random sequences in R programming. sample() function provides the feasibility of generating such random objects from given vectors, either with or without replacement. The following code shows an example that 32 numbers with replacement drawn from 50 integers from 1 to 50.