title: How to display count of a subgroup with ggplotly() tooltip = "text" in R
body: <p>does anyone know how I could display the count per group within the tooltip with <code>ggplotly()</code> using <code>grom_bar</code>, that shows already at least visually how many times <code>Very Good</code> <code>cut</code> and <code>Colour</code> <code>E</code> occured together in df? How should I address the count in the <code>text</code> aesthetics, in this case? And, I already know that if I change <code>ggplotly(p, tooltip = "all")</code> I see the count. I also checked this link <a href="https://stackoverflow.com/questions/54505903/how-to-control-count-in-tooltip-for-ggplotly-with-filled-bar-plot-in-r">How to control &quot;count&quot; in tooltip for ggplotly with filled bar plot in R</a>    .  But I would like to have the flexibility of <code>text</code> so I could customize the tip. 
  Thanks in advance!</p>
  
  <pre><code>library(ggplot2)
  library(plotly)
  data("diamonds")
  p = ggplot(diamonds, aes(cut,   fill = as.factor(color), 
                     text = paste0("Cut: ", cut,"&lt;br&gt;Count: ", ???, "&lt;br&gt;Color: ",color, "&lt;br&gt;Count: ", ???))
        ) + 
  geom_bar()
  
  ggplotly(p, tooltip = "text")
  </code></pre>