Hello I have a set of data that holds Latitude and Longitude Coordinates in the format: "22.0N", "2.0E" and I want to be able to work with that data numerically. I'm new to R, so I'm wondering if anyone can help me convert the column of data (fbdata$Latitude (Deg)) to something more usable. i.e. Southern latitudes and Eastern Longitudes negative and without any letters so that I can change it from a character class. This was the code I came up with that obviously doesn't work (thats why I'm here!)
for (i in fbdata$Latitude..Deg.) {
if (endsWith(fbdata$Latitude..Deg.[i],"S")) {
print (fbdata$Latitude..Deg.[i]) #paste0 ("-",fbdata$Latitude..Deg.)
}
}
Any help would be great!