The following is a simple example of what I am trying to do. I have a data frame which includes states as a variable. I want to create a new column that indicates whether or not its a coastal state and I have a vector of coastal states already made.
states<- c("AZ", "TN", "MI", "NY", "CA", "FL", "MA", "OH")
numbers<- c(1:8)
df<- data.frame(states, numbers)
coastal <- c("NY", "CA", "FL", "MA")