title: Plotting a ggplot world map with countries colored according to number ranges
body: <p>I am trying to plot a map with <code>ggplot</code> for the first time and I am having problems achieving what I have in mind.</p>
  <p>First of all, I have a data frame where every country code is associated to a number. For example:</p>
  <pre><code>id        count
  US        2030
  DE        1001
  UA        730
  SY        229
  </code></pre>
  <p>I would like to obtain a <code>ggplot</code> map where countries are colored by number range (for example: more than 2000 dark red, 1000-2000 red, 1000-600 orange, 600-200 yellow, less than 100 white). The color itself is not important, I just would like to have it becoming paler the lower the count is.</p>
  <p>This is what I tried:</p>
  <pre><code> world_map &lt;- map_data(map = &quot;world&quot;)
   world_map$region &lt;- iso.alpha(world_map$region)
      
   ggplot(df, aes(map_id = id)) +
     geom_map(aes(fill = frequency), map = world_map) +
     expand_limits(x = world_map$long, y = world_map$lat) +
     scale_colour_manual(name = &quot;counts&quot;, values = cols,
                      breaks = c(2000,1000,600,200), 
                      labels=c(&quot;more than 2000&quot;,&quot;2000-1000&quot;,&quot;1000-600&quot;,&quot;600-200&quot;)) +  
     theme_void() +
     coord_fixed()
  </code></pre>
  <p>When I try to execute this code I obtain the following error message</p>
  <blockquote>
  <p>Don't know how to automatically pick scale for object of type
  function. Defaulting to continuous. Error: Aesthetics must be valid
  data columns. Problematic aesthetic(s): fill = frequency.  Did you
  mistype the name of a data column or forget to add after_stat()?</p>
  </blockquote>
  <p>Now I understand that there is a problem in how I set my parameters but I cannot find any solution to this in the internet (or maybe I am too much of a beginner to correctly understand it).</p>