Visualizing COVID-19 Data with Shiny

Posted on Jun 7, 2020

Link to R Shiny project: 

The skills the author demonstrated here can be learned through taking Data Science with Machine Learning bootcamp with NYC Data Science Academy.

Data Science Introduction

Based on data the number COVID-19-related deaths recently surpassed the 100,000+ mark in the United States and is sadly on track to keep growing before an effective vaccine can be researched, manufactured and successfully delivered to the millions of Americans who will depend on it to resume their lives. Until then, disseminating accurate and timely information on the spread of the disease and its associated death toll will be a crucial part of any effective and coordinated response as many world governments have already realized.

To this end, the purpose of this Shiny project was to offer the user different visualizations of US COVID-19 data recording new cases and deaths at the state and county level and which is published on a daily basis by the New York Times (see here for the repository). 

Data Science Questions

The app shows bar charts, scatter plots, lollipop charts and state-level maps displaying case and death counts in the US, over time. These visualizations answer the following questions:

1. Which US states have the largest or smallest COVID-19 case counts today?

2. Which US states have the largest or smallest COVID-19 death counts today?

3. Which US states had the largest or smallest COVID-19 case counts at [x] date?

4. Which US states had the largest or smallest COVID-19 case counts at [x] date?

5. How have contagion rates evolved in [x] state since the beginning of the outbreak?

6. How have death rates evolved in [x] state since the beginning of the outbreak?

7. How did absolute COVID-19 case counts compare between [x] and [y] states at [z] date?

8. How did absolute COVID-19 related deaths counts compare between [x] and [y] states at [z] date?

9. How much of the total case count number in the US does [x] state account for?

10. How much of the total death count number in the US does [x] state account for?

Look in to the shiny app

The first page of the App displays a side-by-side histogram comparison of number of cases and COVID-19-related deaths for two states that the user selects using the two left-hand side menu dropdowns. The user can furthermore input the date for which they want to dynamically visualize the data on different dates using the bottom-most dropdown selector. 

Visualizing COVID-19 Data with Shiny

The second page displays a time-series scatter plot comparison of the growth in number of cases and deaths for two states selected by the user. The app dynamically updates the scatterplots once new state selections are made. 

Visualizing COVID-19 Data with Shiny

The third page of the app displays a lollipop chart comparison of cases and COVID-19 related deaths for different states. This chart perspective gives the user a more holistic view of state-by-state differences in COVID-19 cases in order to better understand differences at a more macro level.

Visualizing COVID-19 Data with Shiny

Lastly, the fourth page presents a color-coded map view of COVID-19 cases and deaths. Similarly to the lollipop chart, this map intends to provide the user with a more macro view of US state differences in COVID-19 cases and deaths. As the user hovers their mouse over the different states shown in the map, pop-ups will reactively appear with the total number of cases and deaths for that state. 

Visualizing COVID-19 Data with Shiny


Future areas of focus to improve this App will be to join this dataset with a state and county demographic dataset in order to derive per capita death and case rates and to get a more accurate picture of which states and counties have fared the best in containing the spread of the disease. Taking this one step further, this demographic data could also be used to show scatterplot regressions between average age and per capita deaths or cases, literacy rates and per capita deaths or cases, poverty rates and per capita deaths or cases, etc to better inform policy makers as to which communities in which counties are the most vulnerable to the disease. 

My contact info is [email protected] if you would like to discuss this project. Thanks for reading!

About Author

Philippe Heitzmann

Philippe is an aspiring data scientist with a track record of using data to drive significant and tangible business results in the Sales & Trading and financial advisory fields. He has hands on experience in R and Python...
View all posts by Philippe Heitzmann >

Leave a Comment

No comments found.

View Posts by Categories

Our Recent Popular Posts

View Posts by Tags

#python #trainwithnycdsa 2019 2020 Revenue 3-points agriculture air quality airbnb airline alcohol Alex Baransky algorithm alumni Alumni Interview Alumni Reviews Alumni Spotlight alumni story Alumnus ames dataset ames housing dataset apartment rent API Application artist aws bank loans beautiful soup Best Bootcamp Best Data Science 2019 Best Data Science Bootcamp Best Data Science Bootcamp 2020 Best Ranked Big Data Book Launch Book-Signing bootcamp Bootcamp Alumni Bootcamp Prep boston safety Bundles cake recipe California Cancer Research capstone car price Career Career Day citibike classic cars classpass clustering Coding Course Demo Course Report covid 19 credit credit card crime frequency crops D3.js data data analysis Data Analyst data analytics data for tripadvisor reviews data science Data Science Academy Data Science Bootcamp Data science jobs Data Science Reviews Data Scientist Data Scientist Jobs data visualization database Deep Learning Demo Day Discount disney dplyr drug data e-commerce economy employee employee burnout employer networking environment feature engineering Finance Financial Data Science fitness studio Flask flight delay gbm Get Hired ggplot2 googleVis H20 Hadoop hallmark holiday movie happiness healthcare frauds higgs boson Hiring hiring partner events Hiring Partners hotels housing housing data housing predictions housing price hy-vee Income Industry Experts Injuries Instructor Blog Instructor Interview insurance italki Job Job Placement Jobs Jon Krohn JP Morgan Chase Kaggle Kickstarter las vegas airport lasso regression Lead Data Scienctist Lead Data Scientist leaflet league linear regression Logistic Regression machine learning Maps market matplotlib Medical Research Meet the team meetup methal health miami beach movie music Napoli NBA netflix Networking neural network Neural networks New Courses NHL nlp NYC NYC Data Science nyc data science academy NYC Open Data nyc property NYCDSA NYCDSA Alumni Online Online Bootcamp Online Training Open Data painter pandas Part-time performance phoenix pollutants Portfolio Development precision measurement prediction Prework Programming public safety PwC python Python Data Analysis python machine learning python scrapy python web scraping python webscraping Python Workshop R R Data Analysis R language R Programming R Shiny r studio R Visualization R Workshop R-bloggers random forest Ranking recommendation recommendation system regression Remote remote data science bootcamp Scrapy scrapy visualization seaborn seafood type Selenium sentiment analysis sentiment classification Shiny Shiny Dashboard Spark Special Special Summer Sports statistics streaming Student Interview Student Showcase SVM Switchup Tableau teachers team team performance TensorFlow Testimonial tf-idf Top Data Science Bootcamp Top manufacturing companies Transfers tweets twitter videos visualization wallstreet wallstreetbets web scraping Weekend Course What to expect whiskey whiskeyadvocate wildfire word cloud word2vec XGBoost yelp youtube trending ZORI