Understand the process of random sampling in R.