1. Learn
  2. /
  3. Courses
  4. /
  5. Sampling in R

Connected

Exercise

Simple sampling with base-R

While dplyr provides great tools for sampling data frames, if you want to work with vectors you can use base-R.

Let's turn it up to eleven and look at the loudness property of each song.

spotify_population is available.

Instructions 1/2

undefined XP
    1
    2
  • Get the loudness column of spotify_population, assigning to loudness_pop.
  • Using base-R, sample loudness_pop to get 100 random values, assigning to loudness_samp.