Angie Felipe
3/6/2018
This presentation is part of Final Project in Developing Data Products JHU course from Coursera.
Here are the rest of the links to have a complete vision of the project.
Resident Spanish Population by age and sex has evolve greatly from 1971 to 2017. This 47 years show a transiction from a pyramidal shape in 1971 to a cask shape since the 80's of last century.
To easily visualize this constrictive path I have develope a shyni app that presents the Resident Spanish Population by age and sex for the selected year in the dataset period (1971-2017).
The dataset used is as follows
X edad sexo year poblacion
1 1 0 Hombres 2017 210606
2 2 0 Mujeres 2017 199294
3 3 1 Hombres 2017 218042
4 4 1 Mujeres 2017 205462
5 5 2 Hombres 2017 223030
6 6 2 Mujeres 2017 209113
n<-1971; pob<-pobEsp[pobEsp$year==n,c(1,2,4)]
ggplot(data=pob) +
geom_bar(aes(edad,poblacion,fill=sexo), stat="identity",subset(pob,pob$sexo=="Male")) +
geom_bar(aes(edad,-poblacion,fill=sexo), stat = "identity",subset(pob,pob$sexo=="Female")) +
scale_y_continuous(labels=abs) +
scale_x_continuous(breaks=seq(0,100,10),
labels=seq(0,100,10)) +
labs(title="Spanish population pyramid by age and sex",
subtitle=paste0("year: ",n),
caption = "data from INE",
x = "Age",
y = "Resident Population") +
coord_flip()