For these exercises we will use the US murders dataset. Make sure you load it prior to starting. (You only need to submit how you loaded the data for this exercise, you don’t need to submit that part of the code for the following exercises about sorting.)

library(dslabs)
data("murders")

Use the $ operator to access the population size data and store it as the object pop. Then use the sort function to redefine pop so that it is sorted (i.e. again assign the result to pop). Finally, select that element of the sorted pop vector that contains the smallest population size. Store the smallest population size in pop_min.

Note: the min function would be more efficient here, but the focus of this exercise is on sorting and indexing.