30 october 2016

Introduction

I've made a simple shiny app (see https://geowizard.shinyapps.io/Be_Age_Pyr/).

The app itself depicts age pyramids for every year between 1990 and 2008.

Age pyramids are a graphical illustration that show the distribution of various age groups in a population (typically that of a country or region of the world), which forms the shape of a pyramid when the population is growing.

Population pyramids are often viewed as the most effective way to graphically depict the age and sex distribution of a population, partly because of the very clear image these pyramids represent. Wikipedia

Background

Slide with R code

The R code used is really quite simple and the "dificulty" lies in the massage of the data into this format :

head(pubdf)
##         males females
## 0-4   313.998 298.910
## 5-9   303.101 288.042
## 10-14 315.731 301.480
## 15-19 322.196 307.820
## 20-24 367.013 353.267
## 25-29 408.125 391.496

The code to draw the plot is just one line :

pyramid(pubdf, Lcol="royalblue3", Rcol="red3")

Result

pyramid(pubdf, Lcol="royalblue3", Rcol="red3", main=paste("Belgian Population pyramid for the year ",year , "\n unit = 1000 individuals"))

Thank You !