I'm trying to solve a problem using r
I have four columns in my dataframe, start_lat, end_lat, start_lng, end_lng and I want to create a new column called ride_distance measuring the difference between the 4 columns.
How do I go about this please ?
start_lat <- c(41.9, 42, 42, 41.9, 41.9)
start_lng <- c(-87.7, -87.7, -87.7, -87.8, -87.6)
end_lat <- c(42, 41.9, 42, 41.9, 41.9)
end_lng <- c(-87.7, -87.7, -87.7, -87.8, -87.6)
distance <- data.frame(start_lat, end_lat, start_lng, end_lng)
Created on 2022-10-15 with reprex v2.0.2