title: Plot map with values for countries as color in R?
body: <p>I have following simple example data which I want to plot on a map with gradient color corresponding to value of the given country. </p>
  
  <pre><code>ddf = read.table(text="
  country value
  USA 10
  UK 30
  Sweden 50
  Japan 70
  China 90
  Germany 100
  France 80
  Italy 60
  Nepal 40
  Nigeria 20
  ", header=T)
  </code></pre>
  
  <p>On google search, I found several sites. However, I am looking for code which is small and clear, and should preferably be fast (I found ggplot methods to be relativley slow). The resolution of world map need not be high. </p>
  
  <p>I tried following code: </p>
  
  <pre><code>library(maptools)
  data(wrld_simpl)
  plot(wrld_simpl)
  </code></pre>
  
  <p>Specific nations can be colored as given on : <a href="https://stackoverflow.com/questions/9096306/using-r-maps-package-colouring-in-specific-nations-on-a-world-map">Using [R] maps package - colouring in specific nations on a world map</a>
  Using the command: </p>
  
  <pre><code>plot(wrld_simpl, col = c(gray(.80), "red")[grepl("^U", wrld_simpl@data$NAME) + 1])
  </code></pre>
  
  <p>But how can I get map with above data in a gradient of colors. 
  Thanks for your help.</p>