title: R ggplot2 Bar Chart with Round Corners on Top of Bar
body: <p>I would like to create a ggplot2 bar chart with round corners at the top of the bars. Consider the following example data:</p>
  
  <pre><code>data &lt;- data.frame(x = letters[1:3],
                     y = c(5, 1, 4))
  </code></pre>
  
  <p>Based on the ggchicklet package, I can draw a ggplot2 bar chart with rounded corners:</p>
  
  <pre><code>library("ggplot2")
  library("ggchicklet")
  
  ggplot(data, aes(x, y)) +
    geom_chicklet(radius = grid::unit(10, 'mm'))
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/EydqX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EydqX.png" alt="enter image description here"></a></p>
  
  <p>However, as you can see in the image, the corners are round on both sides of the bars. How could I create a ggplot2 bar chart, where only the top of the bars are round?</p>