title: How to add labels to points conditionally in a city map using ggmap
body: <p>I was trying to label points using name on the map conditionally for a city.</p>
  
  <p><strong>Data</strong></p>
  
  <pre><code>name |s  Latitude |s Longitude |s Frequency
  
  Pelham Bay Park | 40.865556 | -73.808333 | 32
  
  Greenbelt        | 40.58846 | -74.139073  | 10
  
  Van Cortlandt Park | 40.8978 | -73.8839 | 3
  
  Flushing Meadows–Corona Park | 40.745833 | -73.844722 | 5
  
  Central Park | 40.783333 | -73.966667 |22
  </code></pre>
  
  <p><strong>Code</strong></p>
  
  <pre><code>library(ggmap)
  town &lt;- get_map(location = "New York", zoom = 10)
  
  mapPoints &lt;- ggmap(town) + 
    geom_point(aes(x = work_count$Longitude, y = work_count$Latitude, size = work_count$Frequency), data = work_count, alpha = .5) +
  geom_text(aes(label=ifelse(work_count$Frequency&gt;quart(work_count$Frequency)[2],as.character(work_count$name),'')),hjust=0,vjust=0)
  
  quart &lt;- function(x) {
    x &lt;- sort(x)
    n &lt;- length(x)
    m &lt;- (n+1)/2
    if (floor(m) != m) {
       l &lt;- m-1/2; u &lt;- m+1/2
    } else {
       l &lt;- m-1; u &lt;- m+1
     }
     c(Q1=median(x[1:l]), Q3=median(x[u:n]))
   }
  mapPoints
  </code></pre>
  
  <p>I am getting the following error:
  <strong>Error: Aesthetics must be either length 1 or the same as the data (5): label, x, y</strong>
  Any help is appreciated</p>