Start by loading the library and data.
library(dslabs)
data(murders)
7. Use the %in%
operator to create a logical vector that answers the
question: which of the following are actual abbreviations: MA, ME, MI,
MO, MU? Store your result in correct_abb
8. Extend the code you used in exercise 7 to report the one entry that
is not an actual abbreviation. Hint: use the !
operator, which
turns FALSE
into TRUE
and vice versa, then which
to obtain an
index. Store your result in false_entry
Note: Keep the order of the abbrevations in order to get the correct evaluation.