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 KZbin 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.
@joshuadelabruere42624 жыл бұрын
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.
@sergiocosta61514 жыл бұрын
Thanks for the contribution, i accepted your pull request on github.
@sandralissete900910 ай бұрын
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.
@maksim09334 жыл бұрын
Very nice code! Thanks! However, generally accepted for females - on right, males - on left. But this may vary in different scientific societies.
@ProfBoggs3 жыл бұрын
You are correct. At least in English-language demography publications, males are on the left and females are on the right.
@mubangansofu74692 жыл бұрын
Fantastic video.. please note tidyverse contains ggplot2 library so loading tidyverse is enough.
@jasonrobin73064 жыл бұрын
I don't understand how the url link works.
@Lala-eh7mr2 жыл бұрын
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
@sergiocosta61512 жыл бұрын
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