Application due 4/24 at
8:59 pm Chicago time
Documentation due 4/26 at 8:59 pm Chicago time
Project 3 will be an individual project to
give people some more practice with writing a web-based
application that visualizes data in multiple ways using R and
Shiny and ggplot2 and mapview. In this project we will focus on
data at the census block and census tract level to look at data at
the block, neighborhood, and city level.
This project will focus on using R to
visualize data on electrical power usage in Chicago in 2010, and
use shiny to give people an interactive interface to create those
visualizations. In Project 1 we looked at the US as a whole and at
different states to see how they were different in their energy
mixes. In Project 2 we looked at individual power plants. Here we
are going to look at data on electricity and gas usage by census
block in the city of Chicago to see how neighborhoods, types of
buildings, age of buildings can affect how much power is used
throughout the year. This project can also serve as a model for
looking at other kinds of census data related to the Chicago (or
other areas of the US).
The file contains information per census
block, conveniently including the Chicago Community area that
block belongs to, which will make it easier to create subsets of
the dataset. Each census block may have multiple lines where each
line is for a different building type or building subtype. For
each line we get the electricity usage per month and the gas usage
per month, the total population, average number of stories for the
buildings and the average age of the buildings, among other
things. As with many files of real data there are missing values.
There are also summary lines for each Chicago Community Area.
For this assignment you can
make changes to the data files before you load them into R, and
you very likely should make some changes to shrink the size of the
data file. You need to clearly document how you modify the files
in your website to the extent that someone following your
instructions could recreate your files from the originals. Note
that some lines have
duplicate census block #s with different types of building in
the same census block.
Once you convert the raw data files into the
files you plan to use I would again suggest playing with the data
in RStudio or Jupyter to try out various manipulations and
visualizations before creating the user interface in Shiny.
We will be using mapview for the mapping this
time as it works particularly well with census data. You should install the tigris and
mapview packages into R.
Again you will be writing your code to run
full screen in a web browser at 1920 x 1080 resolution and it
should run on all current browsers (Chrome, Safari, Firefox,
Explorer, Edge, etc.). The
fonts and visualization primitives you create should be work
effectively at that scale. The user should never to scroll the
window, ever, so you should experiment with different ways to
organize the information and controls to find the most effective
combinations. Users will be using a mouse / trackpad to interact
so make sure your controls are reachable and at an appropriate
size.
For
40% you need to:
read in your datafile and create an interactive
visualization in R and Shiny on Shinyapps.io that initially
shows a properly centered and scaled mapview map of the Near
West Side Community Area.
by default it should show the total electrical usage
over the entire year as a heatmap
allow the user to choose to see Gas or Electricity or
Building Age or Building Type or Building Height or
Total Population. If the census block has multiple lines
then you will need to create a 'Multiple' entry and
correctly integrate the multiple values.
allow the user to pick a particular month or the total
for the entire year to see the electricity or gas usage
allow the user to see all building types or only one
particular kind of building type. (here you still may
need to integrate multiple census block lines if they
are the same building type)
map is pannable and zoomable with the block heatmap
updating dynamically
map has a reset button to go back to the original view
appropriate legend
show graphs showing the total amount of electricity
and gas used in the current census blocks being shown
for each month of the year
show that same electricity and gas data as tables
colors are appropriate for the map and its possible to
see the map through the heatmap
have an 'about page' in your app with appropriate
credits
For
an additional 30% you need to the ability to compare two
Community Areas
Split the screen in two. By default the left should show the
Near West Side and the right should show the Loop with
appropriately scaled and zoomed maps.
give the user access to the same set of controls above for
each map
give the user access to the same graphs as above for each
map
ability to choose a Community Area from a dropdown menu of
the 77 Chicago Community Areas - choosing a community area
should automatically pan and zoom the map to show a proper
view of that community area.
the colors should be consistent across all the
visualizations in your interface
each map is pannable and zoomable with the heat maps
updating dynamically
each map has a reset button to go back to the original view
allow the user to choose from three different appropriate
sets of legend colors
For
an additional 30% you need to allow the user to see all of
Chicago
allow the user to view the entire city of Chicago in either
(or both) of the views in a pannable / zoomable / resettable
map.
integrate the data from the census blocks into census tracts
(Chicago has roughly 10,000 census blocks as part of 900
census tracts) and allow the user to show the same data as
above at the tract level for the entire City of Chicago
allow the user to show the 10% census tracts within the
entire city with the:
oldest buildings
newest building
tallest buildings
blocks that use the most electricity over the year
blocks that use the most gas over the year
most population
most occupied percentage
highest percentage of renters
Graduate
Students need to add:
allow the user to integrate two other related pieces of US
2010 census data into the program.
In all of these case you need to make sure that your
visualizations are well constructed with good color and font
choices, proper labeling, and that they effectively reveal the
truth about the data to the user.
Note that as part of the web page part of the grade you will need
to use your interface to show your findings, so make sure that the
way your interface displays information is clear.
Turning in the Project
There aretwo due datesfor the project.
The source code and
application are due first.
Again you
should host your solution using Shinyapps.io. For
this project you do not need to have your solution running on
Shinyapps.io but it should be able to run locally in RStudio and
in a local browser using Shiny.
Your code should be turned in and made available on GitHub ( https://github.com/)
in a public repository for the project. You can keep the
repository private while doing your development. I would suggest
setting up the GitHub project early and regularly pushing code to
it as a backup.
It is important to note that 'getting it
to work' is just a prerequisite to using the application to find
answers to your questions. It is that usage that will give you
ideas on how to improve your app to make it easier and more
intuitive to find those things. Writing the application at the
last minute pretty much guarantees that you will not come up
with an intuitive interface.
Before the application due date&time please send an email to
andy and abeer with the URL of your GitHub site and your Shinyapps site.
The second deadline is for the
documentation which should be part of the web page you created
at the beginning of the course.
This page should have several
sections including:
link to your visualization solution
1 page worth of text on an introduction and a description
of how to use your application and the things you can do
with it.
1 page worth of text on the data you used, including where
you got it, what you did to it.
link to your project on GitHub giving access to your well
commented source code, any necessary data files, and any
instructions necessary to run it. These instructions should
start from the assumption that the reader has a web browser
on their computer and tells the user everything else he/she
needs to know and do to get it running using R studio,
including installing correct versions of all the required
software.
1 page worth of text on what interesting things you found
about the data using your application.
all of which should have plenty
of screenshots with meaningful captions. Web pages like this
can be very helpful later on in helping you build up a
portfolio of your work when you start looking for a job so
please put some effort into it.
You should also create a 5 minute YouTube video showing the
use of your application including narration with decent
audio quality. That video should be in a very obvious place
on your web page. The easiest way to create the video is to
use a screen-capture tool while interacting with your
application, though you will most likely find its useful to
do some editing afterwards to tighten the video up. If you
do decide to use your phone or tablet to make the video,
then please shoot the video in landscape rather than
portrait orientation. Your video should show the
capabilities of your tool through a set of specific examples
of interesting things you found in the data.
I will be linking your web
page to the course notes so please send andy and the TA a nice
jpg image of your visualization for the web along with the
link to your website before the deadline. The image should be
named p3.<your_last_name>.<your_first_name>.jpg
and be roughly 1920 x 1080
Once you
have your web page done, send the URL to Andy and the TA
before the deadline. We will respond to this email as your
'receipt'.
An important part
of creating these kinds of applications is getting feedback
and using it to improve your design, and learning to give
quality feedback to others.
Normally we would be spending time in class for each person
to show off their work and get feedback. This term we will
be doing this asynchronously. See the course notes for week
15 for more details.