title: How to find whole distance between two points in a curved line in R?
body: <p>I have a similar line graph plotted using R plot function (<code>plot(df)</code>)</p>
  
  <p><a href="https://i.stack.imgur.com/l46a9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/l46a9.png" alt="enter image description here"></a></p>
  
  <p>I want to get distance of the whole line between two points in the graph (e.g., between x(1) and x(3)). How can I do this?</p>