I have some rather messy degrees, decimal minutes coordinates (the source of which is out of my control) in the following format (see below). I am trying to work out the distance between the points ultimately.
minlat <- "51 12.93257'"
maxlat <- "66 13.20549'"
minlong <- "- 5 1.23944'"
maxlong <- "- 5 1.36293'"
As they are they are in a rather unfriendly format for (from measurements
package):
measurements::conv_unit(minlat, from = 'deg_dec_min', to = 'dec_deg')
and ultimately
distm(c(minlong, minlat), c(maxlong, maxlat), fun = distHaversine)
I think I need to use the gsub( to get them into a friendly format, whereby I would like them to be
minlat <- 51 12.93257 # removing the double space
minlong <- -4 1.36293 # removing the double space and the space after the -
I've been messing around with gusb( all morning and it has beaten me, any help would be great!!