Shiny App: NYC Projected Population

iair kleiman
20/6/2015

Dataset Intro

-This shiny app uses a dataset downloaded from the following web address

https://data.cityofnewyork.us/City-Government/2040-Population-Projection-Tables/kjk4-7tzy

-It was collected by the Department of City Planning (DCP) of New York.

-This app uses a dataset of New York city population projections from 2010 to 2040, for every Borough and every age group from new borns up to 85+ years.

App Layout

This app has 3 main layout Component

  • A side Panel
  • A main panel
  • Tabset above the main panel (Table, Plot & Help)
project <- read.csv("./Data/project.csv")
str(project)
'data.frame':   630 obs. of  4 variables:
 $ Borough   : Factor w/ 5 levels "Bronx","Brooklyn",..: 1 1 1 1 1 1 1 1 1 1 ...
 $ Age_5     : int  0 5 10 15 20 25 30 35 40 45 ...
 $ Year      : int  2010 2010 2010 2010 2010 2010 2010 2010 2010 2010 ...
 $ Population: int  103144 98664 99159 115662 112897 105710 97824 91016 96073 97569 ...

App Objective

This app will performe 3 basic operations

  • Filter the Dataset based on Age, Borough and Projected Years
  • Plot the Population (Y Axis) against either Age, Borough or Projecter Years
  • Move around ploting variable options such as Facets, Colors, trend lines

Sample Plot

library(ggplot2)
ggplot(project, aes(x = Age_5, y = Population)) + geom_point() +  geom_smooth() + facet_grid(.~Borough)

plot of chunk sample plot