The dplyr package has a function to gather a sample from your dataset, sample(). You pass in the dataset to operate against and how many samples you want drawn, sample_n(), and the fraction percentage, sample_frac(), as in this example:
data <- sample_n(players, 30) glimpse(data)
We see the results as shown in the following screenshot:
Note that there are 30 observations in the results set, as requested.