Q:

maps r plot distances with color on these

perhaps you have an idea and could help me. I have following data: 
 lon.x <- c(11.581981, 13.404954, 9.993682,  7.842104 , 11.741185)
 lat.x <- c(48.135125, 52.520007, 53.551085, 47.999008, 48.402880)
 lon.y <- c(8.801694, 7.842104 , 11.581981, 13.404954,  7.842104 )
 lat.y <- c(53.079296,47.999008,  48.135125, 52.520007, 47.999008)
 pred <- c(1,2,3,4,5)
 data <- data.frame(cbind(lon.x, lat.x, lon.y, lat.y, pred))

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. 
Now, I would like to make a map in R, with
(1) the direct distances between the x and y coordinates as a line
(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". 
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? 
I have currently only made to receive a (very complicated) google map of Germany: 
              library(mapproj)
              map <- get_map(location = 'Germany', zoom = 6.2)
              ggmap(map)

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!

A:

You can use ggplot2 to add lines onto the plot.
library(ggplot2)
library(ggmap)
map <- get_map(location = 'Germany', zoom = 6)

ggmap(map) +
  geom_segment(data=data, aes(x=lon.x, xend=lon.y, y=lat.x, yend=lat.y, color=pred), size=2) +
  scale_color_continuous(high="red", low="blue")

As for the simpler map, you can download shape files (just the outlines of countries) from www.gadm.org. Level 0 maps are just the country, level 1 have state boundaries, etc. To use one of these, download the file from the website and use this code:
load("DEU_adm0.RData")
gadm <- fortify(gadm)

ggplot(gadm) +
  geom_path(aes(x=long, y=lat, group=group)) + 
  geom_segment(data=data, aes(x=lon.x, xend=lon.y, y=lat.x, yend=lat.y, color=pred), size=2) +
  scale_color_continuous(high="red", low="blue")

