I am trying to figure out how to show the incidents happening only in 2016. The format is a chr format and looks like "2016-12-31". Is there a way to search for values only from 2016?
Current code:
most_fatalities_2016 <- gun_violence[which(gun_violence$date == "2016"), select = c("state", "city_or_county")]
I guess I'm looking for the r function that acts like the LIKE function in SQL. Any help?