Friends could help me calculate the distance using the distm function for the code below. I have two databases, one containing properties coordinates and the other industry coordinates. I would like to use the distm function to calculate the distance between the two bases. More precisely, from property 1 to industry 1, property 2, to industry 1, and so on. Any help is appreciated.
Thank you very much!
df<-structure(list(Properties = c(1,2,3,4),
Latitude = c(-23.8, -23.8, -23.9, -23.9),
Longitude = c(-49.6, -49.3, -49.4, -49.8),
Waste = c(526, 350, 526, 469)), class = "data.frame", row.names = c(NA, -4L))
df1<-structure(list(Industry = c(1,2,3,4), Latitude = c(-23.4, -23.7, -23.4, -23.8),
Longitude = c(-49.7, -49.4, -49.6, -49.7)), class = "data.frame", row.names = c(NA, -4L))