Population pyramid chart with geom_bar() | Professional dataviz with ggplot2 | R

  Рет қаралды 6,062

Sérgio Costa

Sérgio Costa

Күн бұрын

Пікірлер: 10
@ProfBoggs
@ProfBoggs 3 жыл бұрын
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.
@joshuadelabruere4262
@joshuadelabruere4262 4 жыл бұрын
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.
@sergiocosta6151
@sergiocosta6151 4 жыл бұрын
Thanks for the contribution, i accepted your pull request on github.
@sandralissete9009
@sandralissete9009 10 ай бұрын
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.
@maksim0933
@maksim0933 4 жыл бұрын
Very nice code! Thanks! However, generally accepted for females - on right, males - on left. But this may vary in different scientific societies.
@ProfBoggs
@ProfBoggs 3 жыл бұрын
You are correct. At least in English-language demography publications, males are on the left and females are on the right.
@mubangansofu7469
@mubangansofu7469 2 жыл бұрын
Fantastic video.. please note tidyverse contains ggplot2 library so loading tidyverse is enough.
@jasonrobin7306
@jasonrobin7306 4 жыл бұрын
I don't understand how the url link works.
@Lala-eh7mr
@Lala-eh7mr 2 жыл бұрын
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
@sergiocosta6151
@sergiocosta6151 2 жыл бұрын
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
Discover 7 Hidden Gems in the R Package Ecosystem
20:18
Tom Henry - data science with R
Рет қаралды 13 М.
Кто круче, как думаешь?
00:44
МЯТНАЯ ФАНТА
Рет қаралды 6 МЛН
Players push long pins through a cardboard box attempting to pop the balloon!
00:31
Twin Telepathy Challenge!
00:23
Stokes Twins
Рет қаралды 129 МЛН
2 Years of C++ Programming
8:20
Zyger
Рет қаралды 9 М.
Beat Ronaldo, Win $1,000,000
22:45
MrBeast
Рет қаралды 29 МЛН
I never understood why you can't go faster than light - until now!
16:40
FloatHeadPhysics
Рет қаралды 4,1 МЛН
R tutorial: Creating Maps and mapping data with ggplot2
10:30
Statistics Guides with Prof Paul Christiansen
Рет қаралды 113 М.
How to map population Change GHSL Data in R [2024]
29:35
Milos Makes Maps
Рет қаралды 8 М.
Why Does Diffusion Work Better than Auto-Regression?
20:18
Algorithmic Simplicity
Рет қаралды 383 М.
Кто круче, как думаешь?
00:44
МЯТНАЯ ФАНТА
Рет қаралды 6 МЛН