Exercise: Use the sample() function
The sample()
function takes a vector and returns a random sample from it. The first two of its parameters are:
x
, which defines the vectorsize
, which defines the number of elements we want to include in the random sample
Use the sample()
function and sample 5 random values from the full
variable.
Results
Submit code to see output here.