title: How to plot only Global Maximum Value using geom_text?
body: <pre><code>df%&gt;%
    group_by(approved_date)%&gt;%
    summarise(rev=sum(gmv))%&gt;%
    ggplot(aes(x = approved_date, y = rev)) + 
      geom_line() + 
      geom_smooth(method = 'auto', se = FALSE) + 
      labs(x = 'Date', y = 'Revenue', title = 'Revenue by Date') +
      scale_y_continuous(labels = function(x) format(x, scientific = FALSE)) +
      stat_peaks(colour = "red", span = NULL) + 
      stat_valleys(colour = "blue", span = NULL) + 
      geom_text(aes(label = round(rev, 0)),
                vjust = "inward", 
                hjust = "inward",
                show.legend = FALSE,
                check_overlap = TRUE)
  </code></pre>
  
  <p>I have this code which on running labels all values of Local Maxima and Minima. I want only the value of Global Maximum and Global Minimum.How to do that?</p>