I am trying to write a code where I am creating a haversine function to calculate the distance of a dataset containing different properties from the nearest hospital using their geolocation and this is what my code looks like:
However, I get this error which I don't understand as I am using lat2 and ids and have defined it whilst creating the function.
Could someone help me understand the error and probably, fix it too?