Start by loading the library and data.
library(dslabs)
data(murders)
Use the match function to identify the states with abbreviations AK,
MI, and IA. Store your result in matches
.
Hint: start by defining an index of the entries of
murders$abb
that match the three abbreviations, then use the [
operator to extract the states.
Note: Keep the order of the abbrevations as AK, MI and IA in order to get the correct evaluation.