1/26/2021

Project Description

This is the Week 3 Project in Developing Data Products. The project asks us to demonstrate using plotly output to demonstrate mastery of the capability to both create presentation slides and embed the interactive plot in the presentation.

I created a data set featuring information from the Massachusetts Department of Public Health from early January on Covid infections by municipality over a two week period. The y-axis is infection rate and the x-axis is income per capita. To make the plot clearer the data was limited to the 40 communities with the largest populations. Population size is shown in the size of the circle markers.

Findings

  • As income rises the rate of infection falls
  • The biggest circle is Boston which sits in the middle of the plot
  • From inspection population size does not seem to reveal much about infections

R Code

library(readxl)
library(tidyverse)
library(leaflet)
library(plotly)
library(webshot)
LinkPart <- "Covid data Mass Jan.xlsx"


df2 <- read_excel(LinkPart)

df2$Cases100K <- as.numeric(df2$Cases100K)
plot3 <- plot_ly(df2, x = ~Incomepercapita, y = ~Cases100K, type = "scatter", 
                 size = ~Population) %>% 
  layout(title = "Mass Covid Test Rate v Income for Large Municipalities",                                 xaxis = list(title="Income per Capita"), 
           yaxis = list(title="Confirmed COVID Cases per 100K"))

Plot of Data