title: maps r plot distances with color on these
body: <p>perhaps you have an idea and could help me. I have following data: </p>
  
  <pre><code> lon.x &lt;- c(11.581981, 13.404954, 9.993682,  7.842104 , 11.741185)
   lat.x &lt;- c(48.135125, 52.520007, 53.551085, 47.999008, 48.402880)
   lon.y &lt;- c(8.801694, 7.842104 , 11.581981, 13.404954,  7.842104 )
   lat.y &lt;- c(53.079296,47.999008,  48.135125, 52.520007, 47.999008)
   pred &lt;- c(1,2,3,4,5)
   data &lt;- data.frame(cbind(lon.x, lat.x, lon.y, lat.y, pred))
  </code></pre>
  
  <p>where "lon.x" and "lat.x" are longitude-latitude points of a city and "lon.y" and "lat.y" of another city. So there are pairs of cities. </p>
  
  <p>Now, I would like to make a map in R, with</p>
  
  <p>(1) the direct distances between the x and y coordinates as a line</p>
  
  <p>(2) which will receive a different color based on the variable "pred", this could be red for higher values and blue for lower, or thicker lines with higher values of "pred". </p>
  
  <p>The result should be a simple map, with lines between the cities, that are shaped based on the variable "pred". For instance, the line between the first pair of cities would be thinner, while the last one would be thicker. Is that possible? </p>
  
  <p>I have currently only made to receive a (very complicated) google map of Germany: </p>
  
  <pre><code>              library(mapproj)
                map &lt;- get_map(location = 'Germany', zoom = 6.2)
                ggmap(map)
  </code></pre>
  
  <p>But I am not sure how to plot points and especially relations between the points that differ based on "pred". Also a very simple map (not so detailed google map) would be best! Any idea? THANKS!</p>