2024-02-21

Shiny App

The purpose of the Shiny app is to offer the user the selection of any Belgian city or municipality. The app relies on the following packages.

  • leaflet - for mapping purposes
  • maps - contains the dataset world.cities
  • stringr - regex() expressions to extract the city of choice
  • dplyr - for data cleaning purposes
  • shiny - to run the actual app

Looking at the world.cities dataset

                name country.etc   pop   lat  long capital
1 'Abasan al-Jadidah   Palestine  5629 31.31 34.34       0
2 'Abasan al-Kabirah   Palestine 18999 31.32 34.35       0
3       'Abdul Hakim    Pakistan 47788 30.55 72.11       0
4 'Abdullah-as-Salam      Kuwait 21817 29.36 47.98       0
5              'Abud   Palestine  2456 32.03 35.07       0
6            'Abwein   Palestine  3434 32.03 35.20       0
[1] "name"        "country.etc" "pop"         "lat"         "long"       
[6] "capital"    
  • name - name of the city
  • country.etc - name of the country the city is in
  • lat - latitudinal coordinate of the city
  • long - longitudinal coordinate of the city
  • capital - logical whether the city is its country’s capital or not

Mapping example of all capital cities

Scattermap of the capital cities without mapping context