Calculating geographical distances between a point to multiple locations using R

spatial

#1

I have following data

  1. Office location in - Lat and Long format
  2. Multiple Hospital locations - lat and Long format
  3. OSM Road layer.

I want to calculate road distance from office to each hospital using R Code. Final output should be line layer

with distances from office to each hospital.