Julia Breitenbruch
3rd April, 2016
This presentation is part 2 of the Course Project for the Coursera Developing Data Products Class. Part 1 consists of the creation of a Shiny application which has to be deployed on RStudio's Server.
It is available at the following URL: https://jbreiten73.shinyapps.io/proj_old
The source code for the ui.R and server.R files is available at: https://www.github.com/jbreiten73/DataProducts.git
The present App is based on the “world.cities” dataset to be found in the library “maps”. It lists altogether 43645 cities along with their countries, longitude and attitude, population and the information, if it is capital of the country or not.
I sorted the dataset by country and descending population, keeping only those countries, which have at least 150 entries in the “world.cities” dataset.
How it works: You have to choose a country in the “Country” menu, the number of clusters in “Cluster count” (valid entries: 1-9, default:3) and the number of cities in “Numbers of Cities” (valid entries: 15-150, default: 25).
The calculation of the clusters is based on all cities of the respective country contained in the data set.
You will get two figures as a result: One with all cities of the respective countries as data points coloured by the different clusters, the other with the n biggest cities of the respective country (with respect to the population, where n is the number of cities you entered), coloured by the different clusters and labeled by the city names.
If you choose for example “Germany” as “Country”“, 5 as "Cluster count”“ and 25 as "Number of Cities”“, your output should look like this:
This is the result for “Netherlands” as “Country”, 7 as “Cluster count” and 52 as “Number of Cities”: