Creating columns II
Now you're interested in seeing how much distance having to drive along roads (as opposed to in a straight line) adds to trips.
hav_dist() , which computes distance using the Haversine formula, has been defined for you. This function takes the longitude of the origin, the latitude of the origin, the longitude of the destination, and the latitude of the destination, in that order.
Use the function
hav_dist()to create the column
Create the column diff which is the difference between
Find the minimum and the maximum of the
Create my_distance and diff
taxis_my_dist <- taxis %>%
mutate(my_distance = ___,
diff = ___)