I want to add a column “site” to my data frame, where a site name “ISF”,”CB” etc. is assigned to all datapoint falling into the specified Lat/Lon coordinates (they are rectangles). The code runs, but the newly created column stays empty. Whats wrong?
testing %>% mutate(site =
case_when(Lon>=-4.5 & Lon<=-6 & Lat>=53.83333 & Lat<=54.166667 ~ "ISF")),
Lon>=-4 & Lon<=-5 & Lat>=53.166667 & Lat<=53.666667 ~ "NorthAng",
Lon>=-4 & Lon<=-5 & Lat>=52 & Lat<=53 ~ "CB",
Lon>=-5 & Lon<=-6 & Lat>=51.5 & Lat<=52 ~ "CD”))