Thank you for posting a technique that divides the number of males in a cohort by TOTAL population, and number of females in a cohort by TOTAL population. I have seen numerous webpages and TH-cam videos who divide male or female cohort by the total male or female population. Also, thank you for this coding demonstration. This is exactly what I needed.
FYI the gather() and spread() from dplyr have been depreciated. Use pivot_longer() and pivot_wider() as these can accomplish the same result, with clearer syntax.
Hola ami me sale error en scale_fill_manual(name='',values=c('darkred','steelblue'))+ .... Error in `palette()`: ! Insufficient values in manual scale. 10 needed but only 2 provided.
how could the propec scale becomes minus 2.5 till positiive 2.5 , i mean it supposed to be percentages so it couldnt be negative, is the propec for male supposed to be *minus 100? ( i asked) because i literally copy your syntax but my plot turned to be basic stack bar plot
I I mentioned this error in the description of the video and I made available the code that corrects the negative values in the scale. Check te code on my github github.com/sergiocostafh/ggplot2_dataviz/blob/master/Population%20pyramid%20chart%20with%20geom_bar().R
Thank you for posting a technique that divides the number of males in a cohort by TOTAL population, and number of females in a cohort by TOTAL population. I have seen numerous webpages and TH-cam videos who divide male or female cohort by the total male or female population.
Also, thank you for this coding demonstration. This is exactly what I needed.
FYI the gather() and spread() from dplyr have been depreciated. Use pivot_longer() and pivot_wider() as these can accomplish the same result, with clearer syntax.
Thanks for the contribution, i accepted your pull request on github.
Hola ami me sale error en scale_fill_manual(name='',values=c('darkred','steelblue'))+ .... Error in `palette()`:
! Insufficient values in manual scale. 10 needed but only 2 provided.
I don't understand how the url link works.
how could the propec scale becomes minus 2.5 till positiive 2.5 , i mean it supposed to be percentages so it couldnt be negative, is the propec for male supposed to be *minus 100? ( i asked) because i literally copy your syntax but my plot turned to be basic stack bar plot
I I mentioned this error in the description of the video and I made available the code that corrects the negative values in the scale. Check te code on my github github.com/sergiocostafh/ggplot2_dataviz/blob/master/Population%20pyramid%20chart%20with%20geom_bar().R
Very nice code! Thanks! However, generally accepted for females - on right, males - on left. But this may vary in different scientific societies.
You are correct. At least in English-language demography publications, males are on the left and females are on the right.
Fantastic video.. please note tidyverse contains ggplot2 library so loading tidyverse is enough.