title: Population Pyramid with Gender surplus in R
body: <p>On Wikipedia, there is a fantastic population pyramid that shows gender surplus.
  How could I recreate this in R using ggplot2, &amp;/or plotly?</p>
  <p>It's essentially a dual-stacked bar plot, which has been oriented by 90 degrees.</p>
  <pre><code># Here is some population data
  
  library(wpp2019)
  # Male
  data(popM)
  # Female
  data(popF)
  </code></pre>
  <p><a href="https://i.stack.imgur.com/2UfpF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2UfpF.png" alt="Population Pyramid with Gender surplus" /></a></p>
  <p><a href="https://en.wikipedia.org/wiki/Demographics_of_the_United_States" rel="nofollow noreferrer">Wikipedia: Demographics of the United States</a></p>