Introduction
This winter break, I wanted to practice my R programming on some topics I’d like to explore for my upcoming thesis. Included below are my results, which I’m publishing for others to use or recreate.✝
It goes without saying that COVID-19 has had a significant impact on the global economy. In the framework of urban economics, we can picture COVID-related phenomena as disamenities (or amenities) that affect the housing decisions of individuals. For example, we can think of COVID case counts, good government, or the ability to work remotely as factors that have an influence on where people live. However, whether these factors have positive or negative impacts is harder to discern.
Below, I visualize select COVID data related to epidemiology, politics, economics, and real estate. The visualizations, by default, focus on the state of Hawaii. However, most visualizations are fully interactable, and other states may be selected (except for the policy timeline).
All data is provided by the C3.ai data lake except for policy data, which is taken directly from the Oxford Covid-19 Government Response Tracker (OxCFRT).
✝ Please cite as: Chen, Tony. 2020. Trends in Real Estate: The Hawai’i Market Contextualized in COVID and the Economy.
# Setup
source("c3aidatalake.R")
if (!require(tidyverse)) install.packages("tidyverse")
if (!require(httr)) install.packages("httr")
if (!require(jsonlite)) install.packages("jsonlite")
if (!require(fitdistrplus)) install.packages("fitdistrplus")
if (!require(maps)) install.packages("maps")
if (!require(mapproj)) install.packages("mapproj")
if (!require(zoo)) install.packages("zoo")
if (!require(lubridate)) install.packages("lubridate")
if (!require(ggplot2)) install.packages("ggplot2")
if (!require(plotly)) install.packages("plotly")
if (!require(timevis)) install.packages("timevis")
library(tidyverse)
library(httr)
library(jsonlite)
library(fitdistrplus)
library(maps)
library(mapproj)
library(zoo)
library(lubridate)
library(ggplot2)
library(plotly)
library(timevis)
options(scipen = 999)
Instructions
For all interactive graphs: click on legend entries to hide/show states Quick double click to isolate 1 state or show all states.
For 2D graphs: click-and-drag on the chart to zoom, double-click to autoscale, shift-and-drag to pan. See top right corner for more options.
For 3D graphs: click-and-drag to move camera, scroll to zoom. See top right corner for more options.
For policy timeline: click-and-drag to move horizontally (across time) or vertically (see more policy developments). Hover over text for policy details. +/- buttons in the top right corner for zoom.
COVID/Epidemiological Statistics
Epidemiological data is provided by John Hopkins University, the US Census Bureau, and the University of Washington through the C3.AI data lake.
Let’s dive into some data from a public health perspective. Specifically, we’ll look at the rate of increases in cases in each state, how mortality rates relate to senior populations, and hospital resources.
Due to key similarities in demographics (e.g., senior populations), industry (tourism), and real estate (retirement destination), we’ll use Florida as our default comparison state. However, data for any state (+ D.C. and Puerto Rico) can be viewed individually or together.
# Scraping COVID Cases Data (State & National) A full list of states + D.C. &
# Puerto Rico
states_list <- list("Alabama_UnitedStates", "Alaska_UnitedStates", "Arizona_UnitedStates",
"Arkansas_UnitedStates", "California_UnitedStates", "Colorado_UnitedStates",
"Connecticut_UnitedStates", "Delaware_UnitedStates", "DistrictofColumbia_UnitedStates",
"Florida_UnitedStates", "Georgia_UnitedStates", "Hawaii_UnitedStates", "Idaho_UnitedStates",
"Illinois_UnitedStates", "Indiana_UnitedStates", "Iowa_UnitedStates", "Kansas_UnitedStates",
"Kentucky_UnitedStates", "Louisiana_UnitedStates", "Maine_UnitedStates", "Maryland_UnitedStates",
"Massachusetts_UnitedStates", "Michigan_UnitedStates", "Minnesota_UnitedStates",
"Mississippi_UnitedStates", "Missouri_UnitedStates", "Montana_UnitedStates",
"Nebraska_UnitedStates", "Nevada_UnitedStates", "NewHampshire_UnitedStates",
"NewJersey_UnitedStates", "NewMexico_UnitedStates", "NewYork_UnitedStates", "NorthCarolina_UnitedStates",
"NorthDakota_UnitedStates", "Ohio_UnitedStates", "Oklahoma_UnitedStates", "Oregon_UnitedStates",
"Pennsylvania_UnitedStates", "PuertoRico_UnitedStates", "RhodeIsland_UnitedStates",
"SouthCarolina_UnitedStates", "SouthDakota_UnitedStates", "Tennessee_UnitedStates",
"Texas_UnitedStates", "Utah_UnitedStates", "Vermont_UnitedStates", "Virginia_UnitedStates",
"Washington_UnitedStates", "WestVirginia_UnitedStates", "Wisconsin_UnitedStates",
"Wyoming_UnitedStates")
# Fetch facts about United States
locations <- fetch("outbreaklocation", list(spec = list(filter = "contains(id, 'UnitedStates')")),
get_all = TRUE)
# Total number of confirmed cases and deaths, by state
today <- Sys.Date() - ddays(14)
casecounts <- evalmetrics("outbreaklocation", list(spec = list(ids = states_list,
expressions = list("JHU_ConfirmedCases", "JHU_ConfirmedDeaths"), start = "2020-01-01",
end = today, interval = "DAY")), get_all = TRUE)
# Fetch facts about United States
populations <- fetch("populationdata", list(spec = list(filter = "contains(id, 'UnitedStates') && (populationAge == 'Total') && gender == 'Male/Female' && year >= 2010 && origin == 'United States Census'",
limit = -1)), get_all = TRUE)
# Fetch census data
census <- evalmetrics("outbreaklocation", list(spec = list(ids = states_list, expressions = list("TotalPopulation"),
start = "2010-01-01", end = "2020-01-01", interval = "YEAR")), get_all = TRUE)
# Fetch states' CDS data
states <- fetch("outbreaklocation", list(spec = list(filter = "contains(id, 'UnitedStates') && locationType == 'state'")),
get_all = TRUE) %>% dplyr::select(-location) %>% unnest_wider(fips, names_sep = ".") %>%
dplyr::select(id, everything())
# Fetch estimates from the University of Washington
uw_estimates <- evalmetrics("outbreaklocation", list(spec = list(ids = states_list,
expressions = list("UniversityOfWashington_AdmisMean", "UniversityOfWashington_AdmisLower",
"UniversityOfWashington_AdmisUpper", "UniversityOfWashington_AllbedMean",
"UniversityOfWashington_AllbedLower", "UniversityOfWashington_AllbedUpper",
"UniversityOfWashington_BedoverMean", "UniversityOfWashington_BedoverLower",
"UniversityOfWashington_BedoverUpper", "UniversityOfWashington_IcubedMean",
"UniversityOfWashington_IcubedLower", "UniversityOfWashington_IcubedUpper",
"UniversityOfWashington_IcuoverMean", "UniversityOfWashington_IcuoverLower",
"UniversityOfWashington_IcuoverUpper", "UniversityOfWashington_InvvenMean",
"UniversityOfWashington_InvvenLower", "UniversityOfWashington_InvvenUpper",
"UniversityOfWashington_NewicuMean", "UniversityOfWashington_NewicuLower",
"UniversityOfWashington_NewicuUpper"), start = "2020-01-01", end = today +
ddays(60), interval = "DAY")), get_all = TRUE)
Case Increases
caseincrease <- casecounts %>% filter(value_id == "JHU_ConfirmedCases") %>% group_by(name) %>%
arrange(dates) %>% mutate(daily_increase = data - lag(data)) %>% mutate(daily_increase_smoothed = rollmean(daily_increase,
7, align = "right", fill = NA)) %>% ungroup() %>% full_join(filter(census, dates ==
"2019-01-01") %>% dplyr::select("name", "data"), by = c(name = "name")) %>% mutate(daily_increase_smoothed_per_100k = 100000 *
daily_increase_smoothed/data.y) %>% filter(!is.na(daily_increase_smoothed_per_100k)) %>%
mutate(name = name %>% str_remove("_UnitedStates"))
f1 <- list(family = "Arial, sans-serif", size = 18, color = "lightgrey")
f2 <- list(family = "Old Standard TT, serif", size = 14, color = "black")
xa <- list(title = "Date", titlefont = f1, showticklabels = TRUE, tickfont = f2,
exponentformat = "E")
ya <- list(title = "Daily increase per 100k people", titlefont = f1, showticklabels = TRUE,
tickfont = f2, exponentformat = "E")
# Plot the data
plot_ly(filter(caseincrease, name == "Hawaii"), x = ~dates, y = ~daily_increase_smoothed_per_100k,
name = "Hawaii", type = "scatter", mode = "lines") %>% add_trace(data = filter(caseincrease,
name == "Alabama"), x = ~dates, y = ~daily_increase_smoothed_per_100k, opacity = 0.3,
name = "Alabama", type = "scatter", mode = "lines", visible = "legendonly") %>%
add_trace(data = filter(caseincrease, name == "Alaska"), x = ~dates, y = ~daily_increase_smoothed_per_100k,
opacity = 0.3, name = "Alaska", type = "scatter", mode = "lines", visible = "legendonly") %>%
add_trace(data = filter(caseincrease, name == "Arizona"), x = ~dates, y = ~daily_increase_smoothed_per_100k,
opacity = 0.3, name = "Arizona", type = "scatter", mode = "lines", visible = "legendonly") %>%
add_trace(data = filter(caseincrease, name == "Arkansas"), x = ~dates, y = ~daily_increase_smoothed_per_100k,
opacity = 0.3, name = "Arkansas", type = "scatter", mode = "lines", visible = "legendonly") %>%
add_trace(data = filter(caseincrease, name == "California"), x = ~dates, y = ~daily_increase_smoothed_per_100k,
opacity = 0.3, name = "California", type = "scatter", mode = "lines", visible = "legendonly") %>%
add_trace(data = filter(caseincrease, name == "Colorado"), x = ~dates, y = ~daily_increase_smoothed_per_100k,
opacity = 0.3, name = "Colorado", type = "scatter", mode = "lines", visible = "legendonly") %>%
add_trace(data = filter(caseincrease, name == "Connecticut"), x = ~dates, y = ~daily_increase_smoothed_per_100k,
opacity = 0.3, name = "Connecticut", type = "scatter", mode = "lines", visible = "legendonly") %>%
add_trace(data = filter(caseincrease, name == "Delaware"), x = ~dates, y = ~daily_increase_smoothed_per_100k,
opacity = 0.3, name = "Delaware", type = "scatter", mode = "lines", visible = "legendonly") %>%
add_trace(data = filter(caseincrease, name == "DistrictofColumbia"), x = ~dates,
y = ~daily_increase_smoothed_per_100k, opacity = 0.3, name = "District of Columbia",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(caseincrease,
name == "Florida"), x = ~dates, y = ~daily_increase_smoothed_per_100k, opacity = 0.3,
name = "Florida", type = "scatter", mode = "lines", visible = "legendonly") %>%
add_trace(data = filter(caseincrease, name == "Georgia"), x = ~dates, y = ~daily_increase_smoothed_per_100k,
opacity = 0.3, name = "Georgia", type = "scatter", mode = "lines", visible = "legendonly") %>%
add_trace(data = filter(caseincrease, name == "Idaho"), x = ~dates, y = ~daily_increase_smoothed_per_100k,
opacity = 0.3, name = "Idaho", type = "scatter", mode = "lines", visible = "legendonly") %>%
add_trace(data = filter(caseincrease, name == "Illinois"), x = ~dates, y = ~daily_increase_smoothed_per_100k,
opacity = 0.3, name = "Illinois", type = "scatter", mode = "lines", visible = "legendonly") %>%
add_trace(data = filter(caseincrease, name == "Indiana"), x = ~dates, y = ~daily_increase_smoothed_per_100k,
opacity = 0.3, name = "Indiana", type = "scatter", mode = "lines", visible = "legendonly") %>%
add_trace(data = filter(caseincrease, name == "Iowa"), x = ~dates, y = ~daily_increase_smoothed_per_100k,
opacity = 0.3, name = "Iowa", type = "scatter", mode = "lines", visible = "legendonly") %>%
add_trace(data = filter(caseincrease, name == "Kansas"), x = ~dates, y = ~daily_increase_smoothed_per_100k,
opacity = 0.3, name = "Kansas", type = "scatter", mode = "lines", visible = "legendonly") %>%
add_trace(data = filter(caseincrease, name == "Kentucky"), x = ~dates, y = ~daily_increase_smoothed_per_100k,
opacity = 0.3, name = "Kentucky", type = "scatter", mode = "lines", visible = "legendonly") %>%
add_trace(data = filter(caseincrease, name == "Louisiana"), x = ~dates, y = ~daily_increase_smoothed_per_100k,
opacity = 0.3, name = "Louisiana", type = "scatter", mode = "lines", visible = "legendonly") %>%
add_trace(data = filter(caseincrease, name == "Maine"), x = ~dates, y = ~daily_increase_smoothed_per_100k,
opacity = 0.3, name = "Maine", type = "scatter", mode = "lines", visible = "legendonly") %>%
add_trace(data = filter(caseincrease, name == "Maryland"), x = ~dates, y = ~daily_increase_smoothed_per_100k,
opacity = 0.3, name = "Maryland", type = "scatter", mode = "lines", visible = "legendonly") %>%
add_trace(data = filter(caseincrease, name == "Massachusetts"), x = ~dates, y = ~daily_increase_smoothed_per_100k,
opacity = 0.3, name = "Massachusetts", type = "scatter", mode = "lines",
visible = "legendonly") %>% add_trace(data = filter(caseincrease, name ==
"Michigan"), x = ~dates, y = ~daily_increase_smoothed_per_100k, opacity = 0.3,
name = "Michigan", type = "scatter", mode = "lines", visible = "legendonly") %>%
add_trace(data = filter(caseincrease, name == "Minnesota"), x = ~dates, y = ~daily_increase_smoothed_per_100k,
opacity = 0.3, name = "Minnesota", type = "scatter", mode = "lines", visible = "legendonly") %>%
add_trace(data = filter(caseincrease, name == "Mississippi"), x = ~dates, y = ~daily_increase_smoothed_per_100k,
opacity = 0.3, name = "Mississippi", type = "scatter", mode = "lines", visible = "legendonly") %>%
add_trace(data = filter(caseincrease, name == "Missouri"), x = ~dates, y = ~daily_increase_smoothed_per_100k,
opacity = 0.3, name = "Missouri", type = "scatter", mode = "lines", visible = "legendonly") %>%
add_trace(data = filter(caseincrease, name == "Montana"), x = ~dates, y = ~daily_increase_smoothed_per_100k,
opacity = 0.3, name = "Montana", type = "scatter", mode = "lines", visible = "legendonly") %>%
add_trace(data = filter(caseincrease, name == "Nebraska"), x = ~dates, y = ~daily_increase_smoothed_per_100k,
opacity = 0.3, name = "Nebraska", type = "scatter", mode = "lines", visible = "legendonly") %>%
add_trace(data = filter(caseincrease, name == "Nevada"), x = ~dates, y = ~daily_increase_smoothed_per_100k,
opacity = 0.3, name = "Nevada", type = "scatter", mode = "lines") %>% add_trace(data = filter(caseincrease,
name == "NewHampshire"), x = ~dates, y = ~daily_increase_smoothed_per_100k, opacity = 0.3,
name = "New Hampshire", type = "scatter", mode = "lines", visible = "legendonly") %>%
add_trace(data = filter(caseincrease, name == "NewJersey"), x = ~dates, y = ~daily_increase_smoothed_per_100k,
opacity = 0.3, name = "New Jersey", type = "scatter", mode = "lines", visible = "legendonly") %>%
add_trace(data = filter(caseincrease, name == "NewMexico"), x = ~dates, y = ~daily_increase_smoothed_per_100k,
opacity = 0.3, name = "New Mexico", type = "scatter", mode = "lines", visible = "legendonly") %>%
add_trace(data = filter(caseincrease, name == "NewYork"), x = ~dates, y = ~daily_increase_smoothed_per_100k,
opacity = 0.3, name = "New York", type = "scatter", mode = "lines", visible = "legendonly") %>%
add_trace(data = filter(caseincrease, name == "NorthCarolina"), x = ~dates, y = ~daily_increase_smoothed_per_100k,
opacity = 0.3, name = "North Carolina", type = "scatter", mode = "lines",
visible = "legendonly") %>% add_trace(data = filter(caseincrease, name ==
"NorthDakota"), x = ~dates, y = ~daily_increase_smoothed_per_100k, opacity = 0.3,
name = "North Dakota", type = "scatter", mode = "lines", visible = "legendonly") %>%
add_trace(data = filter(caseincrease, name == "Ohio"), x = ~dates, y = ~daily_increase_smoothed_per_100k,
opacity = 0.3, name = "Ohio", type = "scatter", mode = "lines", visible = "legendonly") %>%
add_trace(data = filter(caseincrease, name == "Oklahoma"), x = ~dates, y = ~daily_increase_smoothed_per_100k,
opacity = 0.3, name = "Oklahoma", type = "scatter", mode = "lines", visible = "legendonly") %>%
add_trace(data = filter(caseincrease, name == "Oregon"), x = ~dates, y = ~daily_increase_smoothed_per_100k,
opacity = 0.3, name = "Oregon", type = "scatter", mode = "lines", visible = "legendonly") %>%
add_trace(data = filter(caseincrease, name == "Pennsylvania"), x = ~dates, y = ~daily_increase_smoothed_per_100k,
opacity = 0.3, name = "Pennsylvania", type = "scatter", mode = "lines", visible = "legendonly") %>%
add_trace(data = filter(caseincrease, name == "PuertoRico"), x = ~dates, y = ~daily_increase_smoothed_per_100k,
opacity = 0.3, name = "Puerto Rico", type = "scatter", mode = "lines", visible = "legendonly") %>%
add_trace(data = filter(caseincrease, name == "RhodeIsland"), x = ~dates, y = ~daily_increase_smoothed_per_100k,
opacity = 0.3, name = "Rhode Island", type = "scatter", mode = "lines", visible = "legendonly") %>%
add_trace(data = filter(caseincrease, name == "SouthCarolina"), x = ~dates, y = ~daily_increase_smoothed_per_100k,
opacity = 0.3, name = "South Carolina", type = "scatter", mode = "lines",
visible = "legendonly") %>% add_trace(data = filter(caseincrease, name ==
"SouthDakota"), x = ~dates, y = ~daily_increase_smoothed_per_100k, opacity = 0.3,
name = "South Dakota", type = "scatter", mode = "lines", visible = "legendonly") %>%
add_trace(data = filter(caseincrease, name == "Tennessee"), x = ~dates, y = ~daily_increase_smoothed_per_100k,
opacity = 0.3, name = "Tennessee", type = "scatter", mode = "lines", visible = "legendonly") %>%
add_trace(data = filter(caseincrease, name == "Texas"), x = ~dates, y = ~daily_increase_smoothed_per_100k,
opacity = 0.3, name = "Texas", type = "scatter", mode = "lines", visible = "legendonly") %>%
add_trace(data = filter(caseincrease, name == "Utah"), x = ~dates, y = ~daily_increase_smoothed_per_100k,
opacity = 0.3, name = "Utah", type = "scatter", mode = "lines", visible = "legendonly") %>%
add_trace(data = filter(caseincrease, name == "Vermont"), x = ~dates, y = ~daily_increase_smoothed_per_100k,
opacity = 0.3, name = "Vermont", type = "scatter", mode = "lines", visible = "legendonly") %>%
add_trace(data = filter(caseincrease, name == "Virginia"), x = ~dates, y = ~daily_increase_smoothed_per_100k,
opacity = 0.3, name = "Virginia", type = "scatter", mode = "lines", visible = "legendonly") %>%
add_trace(data = filter(caseincrease, name == "Washington"), x = ~dates, y = ~daily_increase_smoothed_per_100k,
opacity = 0.3, name = "Washington", type = "scatter", mode = "lines", visible = "legendonly") %>%
add_trace(data = filter(caseincrease, name == "WestVirginia"), x = ~dates, y = ~daily_increase_smoothed_per_100k,
opacity = 0.3, name = "West Virginia", type = "scatter", mode = "lines",
visible = "legendonly") %>% add_trace(data = filter(caseincrease, name ==
"Wisconsin"), x = ~dates, y = ~daily_increase_smoothed_per_100k, opacity = 0.3,
name = "Wisconsin", type = "scatter", mode = "lines", visible = "legendonly") %>%
add_trace(data = filter(caseincrease, name == "Wyoming"), x = ~dates, y = ~daily_increase_smoothed_per_100k,
opacity = 0.3, name = "Wyoming", type = "scatter", mode = "lines", visible = "legendonly") %>%
layout(title = "Daily Increase in Case Count per 100k People, Averaged over Previous 7 Days",
xaxis = xa, yaxis = ya, margin = list(l = 80, r = 80, b = 100, t = 100, pad = 4))
Using data from John Hopkins University, we can see that daily increases in cases, controlled for population and averaged over past week, is significantly lower in Hawaii than Florida. In fact, Hawaii has had one of the lowest rates of increase throughout the pandemic (accurate as of 6/12/2020).
COVID Death Rates & Elderly Populations
# Fetch data about senior populations by county
senior_population <- fetch("populationdata", list(spec = list(filter = "contains(parent, '_UnitedStates') && (populationAge == '>=65' || populationAge == 'Total') && gender == 'Male/Female' && year == '2018'")),
get_all = TRUE)
# Calculating proportion of seniors/total population
population_age_distribution <- senior_population %>% mutate(location = map_chr(parent,
~.[[1]])) %>% drop_na(value) %>% dplyr::select(location, populationAge, value) %>%
pivot_wider(names_from = populationAge, values_from = value) %>% tidyr::unnest(">=65") %>%
tidyr::unnest("Total") %>% dplyr::rename(over65s = ">=65") %>% dplyr::mutate(proportion_over_65 = over65s/Total) %>%
arrange(desc(proportion_over_65))
# Deaths per county as of today
unitedstates_deaths <- evalmetrics("outbreaklocation", list(spec = list(ids = population_age_distribution$location,
expressions = list("JHU_ConfirmedDeaths"), start = today, end = today, interval = "DAY")),
get_all = TRUE)
age_deaths <- unitedstates_deaths %>% dplyr::select(name, total_deaths = data) %>%
# Bring the two datasets together
inner_join(population_age_distribution, by = c(name = "location")) %>% mutate(deaths_per_million = 1000000 *
total_deaths/Total, name = name %>% str_remove("_UnitedStates") %>% str_replace("_",
", "))
# Plot the data
plot_ly(filter(age_deaths, str_detect(name, "Hawaii")), x = ~proportion_over_65,
y = ~deaths_per_million, text = c(unlist(dplyr::filter(dplyr::select(age_deaths,
name), str_detect(name, "Hawaii")))), hovertemplate = paste("%{text}", "<br>Proportion ≥ 65: %{x}",
"<br>Deaths per million: %{y}"), name = "Hawaii", type = "scatter", mode = "markers") %>%
add_trace(data = filter(age_deaths, str_detect(name, "Alabama")), x = ~proportion_over_65,
y = ~deaths_per_million, opacity = 0.3, text = c(unlist(dplyr::filter(dplyr::select(age_deaths,
name), str_detect(name, "Alabama")))), hovertemplate = paste("%{text}",
"<br>Proportion ≥ 65: %{x}", "<br>Deaths per million: %{y}"), name = "Alabama",
type = "scatter", mode = "markers", visible = "legendonly") %>% add_trace(data = filter(age_deaths,
str_detect(name, "Alaska")), x = ~proportion_over_65, y = ~deaths_per_million,
opacity = 0.3, text = c(unlist(dplyr::filter(dplyr::select(age_deaths, name),
str_detect(name, "Alaska")))), hovertemplate = paste("%{text}", "<br>Proportion ≥ 65: %{x}",
"<br>Deaths per million: %{y}"), name = "Alaska", type = "scatter", mode = "markers",
visible = "legendonly") %>% add_trace(data = filter(age_deaths, str_detect(name,
"Arizona")), x = ~proportion_over_65, y = ~deaths_per_million, opacity = 0.3,
text = c(unlist(dplyr::filter(dplyr::select(age_deaths, name), str_detect(name,
"Arizona")))), hovertemplate = paste("%{text}", "<br>Proportion ≥ 65: %{x}",
"<br>Deaths per million: %{y}"), name = "Arizona", type = "scatter", mode = "markers",
visible = "legendonly") %>% add_trace(data = filter(age_deaths, str_detect(name,
"Arkansas")), x = ~proportion_over_65, y = ~deaths_per_million, opacity = 0.3,
text = c(unlist(dplyr::filter(dplyr::select(age_deaths, name), str_detect(name,
"Arkansas")))), hovertemplate = paste("%{text}", "<br>Proportion ≥ 65: %{x}",
"<br>Deaths per million: %{y}"), name = "Arkansas", type = "scatter", mode = "markers",
visible = "legendonly") %>% add_trace(data = filter(age_deaths, str_detect(name,
"California")), x = ~proportion_over_65, y = ~deaths_per_million, opacity = 0.3,
text = c(unlist(dplyr::filter(dplyr::select(age_deaths, name), str_detect(name,
"California")))), hovertemplate = paste("%{text}", "<br>Proportion ≥ 65: %{x}",
"<br>Deaths per million: %{y}"), name = "California", type = "scatter", mode = "markers",
visible = "legendonly") %>% add_trace(data = filter(age_deaths, str_detect(name,
"Colorado")), x = ~proportion_over_65, y = ~deaths_per_million, opacity = 0.3,
text = c(unlist(dplyr::filter(dplyr::select(age_deaths, name), str_detect(name,
"Colorado")))), hovertemplate = paste("%{text}", "<br>Proportion ≥ 65: %{x}",
"<br>Deaths per million: %{y}"), name = "Colorado", type = "scatter", mode = "markers",
visible = "legendonly") %>% add_trace(data = filter(age_deaths, str_detect(name,
"Connecticut")), x = ~proportion_over_65, y = ~deaths_per_million, opacity = 0.3,
text = c(unlist(dplyr::filter(dplyr::select(age_deaths, name), str_detect(name,
"Connecticut")))), hovertemplate = paste("%{text}", "<br>Proportion ≥ 65: %{x}",
"<br>Deaths per million: %{y}"), name = "Connecticut", type = "scatter",
mode = "markers", visible = "legendonly") %>% add_trace(data = filter(age_deaths,
str_detect(name, "Delaware")), x = ~proportion_over_65, y = ~deaths_per_million,
opacity = 0.3, text = c(unlist(dplyr::filter(dplyr::select(age_deaths, name),
str_detect(name, "Delaware")))), hovertemplate = paste("%{text}", "<br>Proportion ≥ 65: %{x}",
"<br>Deaths per million: %{y}"), name = "Delaware", type = "scatter", mode = "markers",
visible = "legendonly") %>% add_trace(data = filter(age_deaths, str_detect(name,
"DistrictofColumbia")), x = ~proportion_over_65, y = ~deaths_per_million, opacity = 0.3,
text = c(unlist(dplyr::filter(dplyr::select(age_deaths, name), str_detect(name,
"DistrictofColumbia")))), hovertemplate = paste("%{text}", "<br>Proportion ≥ 65: %{x}",
"<br>Deaths per million: %{y}"), name = "District of Columbia", type = "scatter",
mode = "markers", visible = "legendonly") %>% add_trace(data = filter(age_deaths,
str_detect(name, "Florida")), x = ~proportion_over_65, y = ~deaths_per_million,
opacity = 0.3, text = c(unlist(dplyr::filter(dplyr::select(age_deaths, name),
str_detect(name, "Florida")))), hovertemplate = paste("%{text}", "<br>Proportion ≥ 65: %{x}",
"<br>Deaths per million: %{y}"), name = "Florida", type = "scatter", mode = "markers") %>%
add_trace(data = filter(age_deaths, str_detect(name, "Georgia")), x = ~proportion_over_65,
y = ~deaths_per_million, opacity = 0.3, text = c(unlist(dplyr::filter(dplyr::select(age_deaths,
name), str_detect(name, "Georgia")))), hovertemplate = paste("%{text}",
"<br>Proportion ≥ 65: %{x}", "<br>Deaths per million: %{y}"), name = "Georgia",
type = "scatter", mode = "markers", visible = "legendonly") %>% add_trace(data = filter(age_deaths,
str_detect(name, "Idaho")), x = ~proportion_over_65, y = ~deaths_per_million,
opacity = 0.3, text = c(unlist(dplyr::filter(dplyr::select(age_deaths, name),
str_detect(name, "Idaho")))), hovertemplate = paste("%{text}", "<br>Proportion ≥ 65: %{x}",
"<br>Deaths per million: %{y}"), name = "Idaho", type = "scatter", mode = "markers",
visible = "legendonly") %>% add_trace(data = filter(age_deaths, str_detect(name,
"Illinois")), x = ~proportion_over_65, y = ~deaths_per_million, opacity = 0.3,
text = c(unlist(dplyr::filter(dplyr::select(age_deaths, name), str_detect(name,
"Illinois")))), hovertemplate = paste("%{text}", "<br>Proportion ≥ 65: %{x}",
"<br>Deaths per million: %{y}"), name = "Illinois", type = "scatter", mode = "markers",
visible = "legendonly") %>% add_trace(data = filter(age_deaths, str_detect(name,
"Indiana")), x = ~proportion_over_65, y = ~deaths_per_million, opacity = 0.3,
text = c(unlist(dplyr::filter(dplyr::select(age_deaths, name), str_detect(name,
"Indiana")))), hovertemplate = paste("%{text}", "<br>Proportion ≥ 65: %{x}",
"<br>Deaths per million: %{y}"), name = "Indiana", type = "scatter", mode = "markers",
visible = "legendonly") %>% add_trace(data = filter(age_deaths, str_detect(name,
"Iowa")), x = ~proportion_over_65, y = ~deaths_per_million, opacity = 0.3, text = c(unlist(dplyr::filter(dplyr::select(age_deaths,
name), str_detect(name, "Iowa")))), hovertemplate = paste("%{text}", "<br>Proportion ≥ 65: %{x}",
"<br>Deaths per million: %{y}"), name = "Iowa", type = "scatter", mode = "markers",
visible = "legendonly") %>% add_trace(data = filter(age_deaths, str_detect(name,
"Kansas")), x = ~proportion_over_65, y = ~deaths_per_million, opacity = 0.3,
text = c(unlist(dplyr::filter(dplyr::select(age_deaths, name), str_detect(name,
"Kansas")))), hovertemplate = paste("%{text}", "<br>Proportion ≥ 65: %{x}",
"<br>Deaths per million: %{y}"), name = "Kansas", type = "scatter", mode = "markers",
visible = "legendonly") %>% add_trace(data = filter(age_deaths, str_detect(name,
"Kentucky")), x = ~proportion_over_65, y = ~deaths_per_million, opacity = 0.3,
text = c(unlist(dplyr::filter(dplyr::select(age_deaths, name), str_detect(name,
"Kentucky")))), hovertemplate = paste("%{text}", "<br>Proportion ≥ 65: %{x}",
"<br>Deaths per million: %{y}"), name = "Kentucky", type = "scatter", mode = "markers",
visible = "legendonly") %>% add_trace(data = filter(age_deaths, str_detect(name,
"Louisiana")), x = ~proportion_over_65, y = ~deaths_per_million, opacity = 0.3,
text = c(unlist(dplyr::filter(dplyr::select(age_deaths, name), str_detect(name,
"Louisiana")))), hovertemplate = paste("%{text}", "<br>Proportion ≥ 65: %{x}",
"<br>Deaths per million: %{y}"), name = "Louisiana", type = "scatter", mode = "markers",
visible = "legendonly") %>% add_trace(data = filter(age_deaths, str_detect(name,
"Maine")), x = ~proportion_over_65, y = ~deaths_per_million, opacity = 0.3, text = c(unlist(dplyr::filter(dplyr::select(age_deaths,
name), str_detect(name, "Maine")))), hovertemplate = paste("%{text}", "<br>Proportion ≥ 65: %{x}",
"<br>Deaths per million: %{y}"), name = "Maine", type = "scatter", mode = "markers",
visible = "legendonly") %>% add_trace(data = filter(age_deaths, str_detect(name,
"Maryland")), x = ~proportion_over_65, y = ~deaths_per_million, opacity = 0.3,
text = c(unlist(dplyr::filter(dplyr::select(age_deaths, name), str_detect(name,
"Maryland")))), hovertemplate = paste("%{text}", "<br>Proportion ≥ 65: %{x}",
"<br>Deaths per million: %{y}"), name = "Maryland", type = "scatter", mode = "markers",
visible = "legendonly") %>% add_trace(data = filter(age_deaths, str_detect(name,
"Massachusetts")), x = ~proportion_over_65, y = ~deaths_per_million, opacity = 0.3,
text = c(unlist(dplyr::filter(dplyr::select(age_deaths, name), str_detect(name,
"Massachusetts")))), hovertemplate = paste("%{text}", "<br>Proportion ≥ 65: %{x}",
"<br>Deaths per million: %{y}"), name = "Massachusetts", type = "scatter",
mode = "markers", visible = "legendonly") %>% add_trace(data = filter(age_deaths,
str_detect(name, "Michigan")), x = ~proportion_over_65, y = ~deaths_per_million,
opacity = 0.3, text = c(unlist(dplyr::filter(dplyr::select(age_deaths, name),
str_detect(name, "Michigan")))), hovertemplate = paste("%{text}", "<br>Proportion ≥ 65: %{x}",
"<br>Deaths per million: %{y}"), name = "Michigan", type = "scatter", mode = "markers",
visible = "legendonly") %>% add_trace(data = filter(age_deaths, str_detect(name,
"Minnesota")), x = ~proportion_over_65, y = ~deaths_per_million, opacity = 0.3,
text = c(unlist(dplyr::filter(dplyr::select(age_deaths, name), str_detect(name,
"Minnesota")))), hovertemplate = paste("%{text}", "<br>Proportion ≥ 65: %{x}",
"<br>Deaths per million: %{y}"), name = "Minnesota", type = "scatter", mode = "markers",
visible = "legendonly") %>% add_trace(data = filter(age_deaths, str_detect(name,
"Mississippi")), x = ~proportion_over_65, y = ~deaths_per_million, opacity = 0.3,
text = c(unlist(dplyr::filter(dplyr::select(age_deaths, name), str_detect(name,
"Mississippi")))), hovertemplate = paste("%{text}", "<br>Proportion ≥ 65: %{x}",
"<br>Deaths per million: %{y}"), name = "Mississippi", type = "scatter",
mode = "markers", visible = "legendonly") %>% add_trace(data = filter(age_deaths,
str_detect(name, "Missouri")), x = ~proportion_over_65, y = ~deaths_per_million,
opacity = 0.3, text = c(unlist(dplyr::filter(dplyr::select(age_deaths, name),
str_detect(name, "Missouri")))), hovertemplate = paste("%{text}", "<br>Proportion ≥ 65: %{x}",
"<br>Deaths per million: %{y}"), name = "Missouri", type = "scatter", mode = "markers",
visible = "legendonly") %>% add_trace(data = filter(age_deaths, str_detect(name,
"Montana")), x = ~proportion_over_65, y = ~deaths_per_million, opacity = 0.3,
text = c(unlist(dplyr::filter(dplyr::select(age_deaths, name), str_detect(name,
"Montana")))), hovertemplate = paste("%{text}", "<br>Proportion ≥ 65: %{x}",
"<br>Deaths per million: %{y}"), name = "Montana", type = "scatter", mode = "markers",
visible = "legendonly") %>% add_trace(data = filter(age_deaths, str_detect(name,
"Nebraska")), x = ~proportion_over_65, y = ~deaths_per_million, opacity = 0.3,
text = c(unlist(dplyr::filter(dplyr::select(age_deaths, name), str_detect(name,
"Nebraska")))), hovertemplate = paste("%{text}", "<br>Proportion ≥ 65: %{x}",
"<br>Deaths per million: %{y}"), name = "Nebraska", type = "scatter", mode = "markers",
visible = "legendonly") %>% add_trace(data = filter(age_deaths, str_detect(name,
"Nevada")), x = ~proportion_over_65, y = ~deaths_per_million, opacity = 0.3,
text = c(unlist(dplyr::filter(dplyr::select(age_deaths, name), str_detect(name,
"Nevada")))), hovertemplate = paste("%{text}", "<br>Proportion ≥ 65: %{x}",
"<br>Deaths per million: %{y}"), name = "Nevada", type = "scatter", mode = "markers",
visible = "legendonly") %>% add_trace(data = filter(age_deaths, str_detect(name,
"NewHampshire")), x = ~proportion_over_65, y = ~deaths_per_million, opacity = 0.3,
text = c(unlist(dplyr::filter(dplyr::select(age_deaths, name), str_detect(name,
"NewHampshire")))), hovertemplate = paste("%{text}", "<br>Proportion ≥ 65: %{x}",
"<br>Deaths per million: %{y}"), name = "New Hampshire", type = "scatter",
mode = "markers", visible = "legendonly") %>% add_trace(data = filter(age_deaths,
str_detect(name, "NewJersey")), x = ~proportion_over_65, y = ~deaths_per_million,
opacity = 0.3, text = c(unlist(dplyr::filter(dplyr::select(age_deaths, name),
str_detect(name, "NewJersey")))), hovertemplate = paste("%{text}", "<br>Proportion ≥ 65: %{x}",
"<br>Deaths per million: %{y}"), name = "New Jersey", type = "scatter", mode = "markers",
visible = "legendonly") %>% add_trace(data = filter(age_deaths, str_detect(name,
"NewMexico")), x = ~proportion_over_65, y = ~deaths_per_million, opacity = 0.3,
text = c(unlist(dplyr::filter(dplyr::select(age_deaths, name), str_detect(name,
"NewMexico")))), hovertemplate = paste("%{text}", "<br>Proportion ≥ 65: %{x}",
"<br>Deaths per million: %{y}"), name = "New Mexico", type = "scatter", mode = "markers",
visible = "legendonly") %>% add_trace(data = filter(age_deaths, str_detect(name,
"NewYork")), x = ~proportion_over_65, y = ~deaths_per_million, opacity = 0.3,
text = c(unlist(dplyr::filter(dplyr::select(age_deaths, name), str_detect(name,
"NewYork")))), hovertemplate = paste("%{text}", "<br>Proportion ≥ 65: %{x}",
"<br>Deaths per million: %{y}"), name = "New York", type = "scatter", mode = "markers",
visible = "legendonly") %>% add_trace(data = filter(age_deaths, str_detect(name,
"NorthCarolina")), x = ~proportion_over_65, y = ~deaths_per_million, opacity = 0.3,
text = c(unlist(dplyr::filter(dplyr::select(age_deaths, name), str_detect(name,
"NorthCarolina")))), hovertemplate = paste("%{text}", "<br>Proportion ≥ 65: %{x}",
"<br>Deaths per million: %{y}"), name = "North Carolina", type = "scatter",
mode = "markers", visible = "legendonly") %>% add_trace(data = filter(age_deaths,
str_detect(name, "NorthDakota")), x = ~proportion_over_65, y = ~deaths_per_million,
opacity = 0.3, text = c(unlist(dplyr::filter(dplyr::select(age_deaths, name),
str_detect(name, "NorthDakota")))), hovertemplate = paste("%{text}", "<br>Proportion ≥ 65: %{x}",
"<br>Deaths per million: %{y}"), name = "North Dakota", type = "scatter",
mode = "markers", visible = "legendonly") %>% add_trace(data = filter(age_deaths,
str_detect(name, "Ohio")), x = ~proportion_over_65, y = ~deaths_per_million,
opacity = 0.3, text = c(unlist(dplyr::filter(dplyr::select(age_deaths, name),
str_detect(name, "Ohio")))), hovertemplate = paste("%{text}", "<br>Proportion ≥ 65: %{x}",
"<br>Deaths per million: %{y}"), name = "Ohio", type = "scatter", mode = "markers",
visible = "legendonly") %>% add_trace(data = filter(age_deaths, str_detect(name,
"Oklahoma")), x = ~proportion_over_65, y = ~deaths_per_million, opacity = 0.3,
text = c(unlist(dplyr::filter(dplyr::select(age_deaths, name), str_detect(name,
"Oklahoma")))), hovertemplate = paste("%{text}", "<br>Proportion ≥ 65: %{x}",
"<br>Deaths per million: %{y}"), name = "Oklahoma", type = "scatter", mode = "markers",
visible = "legendonly") %>% add_trace(data = filter(age_deaths, str_detect(name,
"Oregon")), x = ~proportion_over_65, y = ~deaths_per_million, opacity = 0.3,
text = c(unlist(dplyr::filter(dplyr::select(age_deaths, name), str_detect(name,
"Oregon")))), hovertemplate = paste("%{text}", "<br>Proportion ≥ 65: %{x}",
"<br>Deaths per million: %{y}"), name = "Oregon", type = "scatter", mode = "markers",
visible = "legendonly") %>% add_trace(data = filter(age_deaths, str_detect(name,
"Pennsylvania")), x = ~proportion_over_65, y = ~deaths_per_million, opacity = 0.3,
text = c(unlist(dplyr::filter(dplyr::select(age_deaths, name), str_detect(name,
"Pennsylvania")))), hovertemplate = paste("%{text}", "<br>Proportion ≥ 65: %{x}",
"<br>Deaths per million: %{y}"), name = "Pennsylvania", type = "scatter",
mode = "markers", visible = "legendonly") %>% add_trace(data = filter(age_deaths,
str_detect(name, "PuertoRico")), x = ~proportion_over_65, y = ~deaths_per_million,
opacity = 0.3, text = c(unlist(dplyr::filter(dplyr::select(age_deaths, name),
str_detect(name, "PuertoRico")))), hovertemplate = paste("%{text}", "<br>Proportion ≥ 65: %{x}",
"<br>Deaths per million: %{y}"), name = "Puerto Rico", type = "scatter",
mode = "markers", visible = "legendonly") %>% add_trace(data = filter(age_deaths,
str_detect(name, "RhodeIsland")), x = ~proportion_over_65, y = ~deaths_per_million,
opacity = 0.3, text = c(unlist(dplyr::filter(dplyr::select(age_deaths, name),
str_detect(name, "RhodeIsland")))), hovertemplate = paste("%{text}", "<br>Proportion ≥ 65: %{x}",
"<br>Deaths per million: %{y}"), name = "Rhode Island", type = "scatter",
mode = "markers", visible = "legendonly") %>% add_trace(data = filter(age_deaths,
str_detect(name, "SouthCarolina")), x = ~proportion_over_65, y = ~deaths_per_million,
opacity = 0.3, text = c(unlist(dplyr::filter(dplyr::select(age_deaths, name),
str_detect(name, "SouthCarolina")))), hovertemplate = paste("%{text}", "<br>Proportion ≥ 65: %{x}",
"<br>Deaths per million: %{y}"), name = "South Carolina", type = "scatter",
mode = "markers", visible = "legendonly") %>% add_trace(data = filter(age_deaths,
str_detect(name, "SouthDakota")), x = ~proportion_over_65, y = ~deaths_per_million,
opacity = 0.3, text = c(unlist(dplyr::filter(dplyr::select(age_deaths, name),
str_detect(name, "SouthDakota")))), hovertemplate = paste("%{text}", "<br>Proportion ≥ 65: %{x}",
"<br>Deaths per million: %{y}"), name = "South Dakota", type = "scatter",
mode = "markers", visible = "legendonly") %>% add_trace(data = filter(age_deaths,
str_detect(name, "Tennessee")), x = ~proportion_over_65, y = ~deaths_per_million,
opacity = 0.3, text = c(unlist(dplyr::filter(dplyr::select(age_deaths, name),
str_detect(name, "Tennessee")))), hovertemplate = paste("%{text}", "<br>Proportion ≥ 65: %{x}",
"<br>Deaths per million: %{y}"), name = "Tennessee", type = "scatter", mode = "markers",
visible = "legendonly") %>% add_trace(data = filter(age_deaths, str_detect(name,
"Texas")), x = ~proportion_over_65, y = ~deaths_per_million, opacity = 0.3, text = c(unlist(dplyr::filter(dplyr::select(age_deaths,
name), str_detect(name, "Texas")))), hovertemplate = paste("%{text}", "<br>Proportion ≥ 65: %{x}",
"<br>Deaths per million: %{y}"), name = "Texas", type = "scatter", mode = "markers",
visible = "legendonly") %>% add_trace(data = filter(age_deaths, str_detect(name,
"Utah")), x = ~proportion_over_65, y = ~deaths_per_million, opacity = 0.3, text = c(unlist(dplyr::filter(dplyr::select(age_deaths,
name), str_detect(name, "Utah")))), hovertemplate = paste("%{text}", "<br>Proportion ≥ 65: %{x}",
"<br>Deaths per million: %{y}"), name = "Utah", type = "scatter", mode = "markers",
visible = "legendonly") %>% add_trace(data = filter(age_deaths, str_detect(name,
"Vermont")), x = ~proportion_over_65, y = ~deaths_per_million, opacity = 0.3,
text = c(unlist(dplyr::filter(dplyr::select(age_deaths, name), str_detect(name,
"Vermont")))), hovertemplate = paste("%{text}", "<br>Proportion ≥ 65: %{x}",
"<br>Deaths per million: %{y}"), name = "Vermont", type = "scatter", mode = "markers",
visible = "legendonly") %>% add_trace(data = filter(age_deaths, str_detect(name,
"Virginia")), x = ~proportion_over_65, y = ~deaths_per_million, opacity = 0.3,
text = c(unlist(dplyr::filter(dplyr::select(age_deaths, name), str_detect(name,
"Virginia")))), hovertemplate = paste("%{text}", "<br>Proportion ≥ 65: %{x}",
"<br>Deaths per million: %{y}"), name = "Virginia", type = "scatter", mode = "markers",
visible = "legendonly") %>% add_trace(data = filter(age_deaths, str_detect(name,
"Washington")), x = ~proportion_over_65, y = ~deaths_per_million, opacity = 0.3,
text = c(unlist(dplyr::filter(dplyr::select(age_deaths, name), str_detect(name,
"Washington")))), hovertemplate = paste("%{text}", "<br>Proportion ≥ 65: %{x}",
"<br>Deaths per million: %{y}"), name = "Washington", type = "scatter", mode = "markers",
visible = "legendonly") %>% add_trace(data = filter(age_deaths, str_detect(name,
"WestVirginia")), x = ~proportion_over_65, y = ~deaths_per_million, opacity = 0.3,
text = c(unlist(dplyr::filter(dplyr::select(age_deaths, name), str_detect(name,
"WestVirginia")))), hovertemplate = paste("%{text}", "<br>Proportion ≥ 65: %{x}",
"<br>Deaths per million: %{y}"), name = "West Virginia", type = "scatter",
mode = "markers", visible = "legendonly") %>% add_trace(data = filter(age_deaths,
str_detect(name, "Wisconsin")), x = ~proportion_over_65, y = ~deaths_per_million,
opacity = 0.3, text = c(unlist(dplyr::filter(dplyr::select(age_deaths, name),
str_detect(name, "Wisconsin")))), hovertemplate = paste("%{text}", "<br>Proportion ≥ 65: %{x}",
"<br>Deaths per million: %{y}"), name = "Wisconsin", type = "scatter", mode = "markers",
visible = "legendonly") %>% add_trace(data = filter(age_deaths, str_detect(name,
"Wyoming")), x = ~proportion_over_65, y = ~deaths_per_million, opacity = 0.3,
text = c(unlist(dplyr::filter(dplyr::select(age_deaths, name), str_detect(name,
"Wyoming")))), hovertemplate = paste("%{text}", "<br>Proportion ≥ 65: %{x}",
"<br>Deaths per million: %{y}"), name = "Wyoming", type = "scatter", mode = "markers",
visible = "legendonly") %>% layout(title = "Deaths per Million and Proportion of Seniors ≥ Age 65",
xaxis = list(title = "Proportion of Population ≥ Age 65", titlefont = f1, showticklabels = TRUE,
tickfont = f2, exponentformat = "E"), yaxis = list(title = "Deaths per Million",
titlefont = f1, showticklabels = TRUE, tickfont = f2, exponentformat = "E"),
margin = list(l = 80, r = 80, b = 100, t = 100, pad = 4))
Hawaii and Florida have substantial senior populations. Kalawao, Hawaii and Sumter, Florida have some of the largest proportion of seniors to the total county population. Other counties of Hawaii, however, have relatively average proportions of seniors - although they have a lower death rate than comparable counties in Florida.
UW COVID-19 Projections
Here, we visualize COVID-related projections from the University of Washington. Specifically, we look at the number of invasive ventilation procedures needed per day, hospital beds needed for COVID, and shortage of beds in Intensive Care Units. These statistics were selected because they help illustrate the relative severity of the virus (i.e., how many cases required professional treatment) and hospital resources.
Invasive Ventilation Procedures Needed per Day
uw_invven <- uw_estimates %>% mutate(name = name %>% str_remove("_UnitedStates")) %>%
filter(value_id %in% c("UniversityOfWashington_InvvenMean", "UniversityOfWashington_InvvenLower",
"UniversityOfWashington_InvvenUpper"), missing == 0)
plot_ly(filter(uw_invven, value_id == "UniversityOfWashington_InvvenUpper") %>% filter(name ==
"Hawaii"), x = ~dates, y = ~data, type = "scatter", mode = "lines", line = list(color = "transparent"),
legendgroup = "Hawaii", name = "Hawaii - Upper Estimate") %>% add_trace(data = filter(uw_invven,
name == "Hawaii") %>% filter(value_id == "UniversityOfWashington_InvvenLower"),
type = "scatter", mode = "lines", fill = "tonexty", fillcolor = "rgba(0,100,170,0.2)",
line = list(color = "transparent"), legendgroup = "Hawaii", name = "Hawaii - Lower Estimate") %>%
add_trace(data = filter(uw_invven, name == "Hawaii") %>% filter(value_id == "UniversityOfWashington_InvvenMean"),
type = "scatter", mode = "lines", line = list(color = "rgb(0,100,170)"),
legendgroup = "Hawaii", name = "Hawaii - Mean Estimate") %>% add_trace(data = filter(uw_invven,
value_id == "UniversityOfWashington_InvvenUpper") %>% filter(name == "Alabama"),
x = ~dates, y = ~data, type = "scatter", mode = "lines", line = list(color = "transparent"),
legendgroup = "Alabama", name = "Alabama - Upper Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, name == "Alabama") %>% filter(value_id ==
"UniversityOfWashington_InvvenLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(255,205,160,0.2)", line = list(color = "transparent"),
legendgroup = "Alabama", name = "Alabama - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, name == "Alabama") %>% filter(value_id ==
"UniversityOfWashington_InvvenMean"), type = "scatter", mode = "lines", line = list(color = "rgb(255,205,160)"),
legendgroup = "Alabama", name = "Alabama - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, value_id == "UniversityOfWashington_InvvenUpper") %>%
filter(name == "Alaska"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Alaska", name = "Alaska - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_invven, name == "Alaska") %>%
filter(value_id == "UniversityOfWashington_InvvenLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(170,225,175,0.2)", line = list(color = "transparent"),
legendgroup = "Alaska", name = "Alaska - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, name == "Alaska") %>% filter(value_id == "UniversityOfWashington_InvvenMean"),
type = "scatter", mode = "lines", line = list(color = "rgb(170,225,175)"),
legendgroup = "Alaska", name = "Alaska - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, value_id == "UniversityOfWashington_InvvenUpper") %>%
filter(name == "Arizona"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Arizona", name = "Arizona - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_invven, name == "Arizona") %>%
filter(value_id == "UniversityOfWashington_InvvenLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(250,170,175,0.2)", line = list(color = "transparent"),
legendgroup = "Arizona", name = "Arizona - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, name == "Arizona") %>% filter(value_id ==
"UniversityOfWashington_InvvenMean"), type = "scatter", mode = "lines", line = list(color = "rgb(250,170,175)"),
legendgroup = "Arizona", name = "Arizona - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, value_id == "UniversityOfWashington_InvvenUpper") %>%
filter(name == "Arkansas"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Arkansas", name = "Arkansas - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_invven, name == "Arkansas") %>%
filter(value_id == "UniversityOfWashington_InvvenLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(220,195,235,0.2)", line = list(color = "transparent"),
legendgroup = "Arkansas", name = "Arkansas - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, name == "Arkansas") %>% filter(value_id ==
"UniversityOfWashington_InvvenMean"), type = "scatter", mode = "lines", line = list(color = "rgb(220,195,235)"),
legendgroup = "Arkansas", name = "Arkansas - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, value_id == "UniversityOfWashington_InvvenUpper") %>%
filter(name == "California"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "California", name = "California - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_invven, name == "California") %>%
filter(value_id == "UniversityOfWashington_InvvenLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(215,190,190,0.2)", line = list(color = "transparent"),
legendgroup = "California", name = "California - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, name == "California") %>% filter(value_id ==
"UniversityOfWashington_InvvenMean"), type = "scatter", mode = "lines", line = list(color = "rgb(215,190,190)"),
legendgroup = "California", name = "California - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, value_id == "UniversityOfWashington_InvvenUpper") %>%
filter(name == "Colorado"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Colorado", name = "Colorado - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_invven, name == "Colorado") %>%
filter(value_id == "UniversityOfWashington_InvvenLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(250,200,235,0.2)", line = list(color = "transparent"),
legendgroup = "Colorado", name = "Colorado - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, name == "Colorado") %>% filter(value_id ==
"UniversityOfWashington_InvvenMean"), type = "scatter", mode = "lines", line = list(color = "rgb(250,200,235)"),
legendgroup = "Colorado", name = "Colorado - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, value_id == "UniversityOfWashington_InvvenUpper") %>%
filter(name == "Connecticut"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Connecticut", name = "Connecticut - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_invven, name == "Connecticut") %>%
filter(value_id == "UniversityOfWashington_InvvenLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(210,210,210,0.2)", line = list(color = "transparent"),
legendgroup = "Connecticut", name = "Connecticut - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, name == "Connecticut") %>% filter(value_id ==
"UniversityOfWashington_InvvenMean"), type = "scatter", mode = "lines", line = list(color = "rgb(210,210,210)"),
legendgroup = "Connecticut", name = "Connecticut - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, value_id == "UniversityOfWashington_InvvenUpper") %>%
filter(name == "Delaware"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Delaware", name = "Delaware - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_invven, name == "Delaware") %>%
filter(value_id == "UniversityOfWashington_InvvenLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(230,230,170,0.2)", line = list(color = "transparent"),
legendgroup = "Delaware", name = "Delaware - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, name == "Delaware") %>% filter(value_id ==
"UniversityOfWashington_InvvenMean"), type = "scatter", mode = "lines", line = list(color = "rgb(230,230,170)"),
legendgroup = "Delaware", name = "Delaware - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, value_id == "UniversityOfWashington_InvvenUpper") %>%
filter(name == "DistrictofColumbia"), x = ~dates, y = ~data, type = "scatter",
mode = "lines", line = list(color = "transparent"), legendgroup = "DistrictofColumbia",
name = "District of Columbia - Upper Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, name == "DistrictofColumbia") %>% filter(value_id ==
"UniversityOfWashington_InvvenLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(160,235,240,0.2)", line = list(color = "transparent"),
legendgroup = "DistrictofColumbia", name = "District of Columbia - Lower Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_invven, name == "DistrictofColumbia") %>%
filter(value_id == "UniversityOfWashington_InvvenMean"), type = "scatter", mode = "lines",
line = list(color = "rgb(160,235,240)"), legendgroup = "DistrictofColumbia",
name = "District of Columbia - Mean Estimate", visible = "legendonly") %>% add_trace(data = filter(uw_invven,
value_id == "UniversityOfWashington_InvvenUpper") %>% filter(name == "Florida"),
x = ~dates, y = ~data, type = "scatter", mode = "lines", line = list(color = "transparent"),
legendgroup = "Florida", name = "Florida - Upper Estimate") %>% add_trace(data = filter(uw_invven,
name == "Florida") %>% filter(value_id == "UniversityOfWashington_InvvenLower"),
type = "scatter", mode = "lines", fill = "tonexty", fillcolor = "rgba(170,205,230,0.2)",
line = list(color = "transparent"), legendgroup = "Florida", name = "Florida - Lower Estimate") %>%
add_trace(data = filter(uw_invven, name == "Florida") %>% filter(value_id ==
"UniversityOfWashington_InvvenMean"), type = "scatter", mode = "lines", line = list(color = "rgb(170,205,230)"),
legendgroup = "Florida", name = "Florida - Mean Estimate") %>% add_trace(data = filter(uw_invven,
value_id == "UniversityOfWashington_InvvenUpper") %>% filter(name == "Georgia"),
x = ~dates, y = ~data, type = "scatter", mode = "lines", line = list(color = "transparent"),
legendgroup = "Georgia", name = "Georgia - Upper Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, name == "Georgia") %>% filter(value_id ==
"UniversityOfWashington_InvvenLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(255,205,160,0.2)", line = list(color = "transparent"),
legendgroup = "Georgia", name = "Georgia - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, name == "Georgia") %>% filter(value_id ==
"UniversityOfWashington_InvvenMean"), type = "scatter", mode = "lines", line = list(color = "rgb(255,205,160)"),
legendgroup = "Georgia", name = "Georgia - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, value_id == "UniversityOfWashington_InvvenUpper") %>%
filter(name == "Idaho"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Idaho", name = "Idaho - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_invven, name == "Idaho") %>%
filter(value_id == "UniversityOfWashington_InvvenLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(170,225,175,0.2)", line = list(color = "transparent"),
legendgroup = "Idaho", name = "Idaho - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, name == "Idaho") %>% filter(value_id == "UniversityOfWashington_InvvenMean"),
type = "scatter", mode = "lines", line = list(color = "rgb(170,225,175)"),
legendgroup = "Idaho", name = "Idaho - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, value_id == "UniversityOfWashington_InvvenUpper") %>%
filter(name == "Illinois"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Illinois", name = "Illinois - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_invven, name == "Illinois") %>%
filter(value_id == "UniversityOfWashington_InvvenLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(250,175,180,0.2)", line = list(color = "transparent"),
legendgroup = "Illinois", name = "Illinois - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, name == "Illinois") %>% filter(value_id ==
"UniversityOfWashington_InvvenMean"), type = "scatter", mode = "lines", line = list(color = "rgb(250,175,180)"),
legendgroup = "Illinois", name = "Illinois - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, value_id == "UniversityOfWashington_InvvenUpper") %>%
filter(name == "Indiana"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Indiana", name = "Indiana - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_invven, name == "Indiana") %>%
filter(value_id == "UniversityOfWashington_InvvenLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(220,195,235,0.2)", line = list(color = "transparent"),
legendgroup = "Indiana", name = "Indiana - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, name == "Indiana") %>% filter(value_id ==
"UniversityOfWashington_InvvenMean"), type = "scatter", mode = "lines", line = list(color = "rgb(220,195,235)"),
legendgroup = "Indiana", name = "Indiana - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, value_id == "UniversityOfWashington_InvvenUpper") %>%
filter(name == "Iowa"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Iowa", name = "Iowa - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_invven, name == "Iowa") %>%
filter(value_id == "UniversityOfWashington_InvvenLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(215,190,190,0.2)", line = list(color = "transparent"),
legendgroup = "Iowa", name = "Iowa - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, name == "Iowa") %>% filter(value_id == "UniversityOfWashington_InvvenMean"),
type = "scatter", mode = "lines", line = list(color = "rgb(215,190,190)"),
legendgroup = "Iowa", name = "Iowa - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, value_id == "UniversityOfWashington_InvvenUpper") %>%
filter(name == "Kansas"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Kansas", name = "Kansas - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_invven, name == "Kansas") %>%
filter(value_id == "UniversityOfWashington_InvvenLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(250,200,235,0.2)", line = list(color = "transparent"),
legendgroup = "Kansas", name = "Kansas - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, name == "Kansas") %>% filter(value_id == "UniversityOfWashington_InvvenMean"),
type = "scatter", mode = "lines", line = list(color = "rgb(250,200,235)"),
legendgroup = "Kansas", name = "Kansas - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, value_id == "UniversityOfWashington_InvvenUpper") %>%
filter(name == "Kentucky"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Kentucky", name = "Kentucky - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_invven, name == "Kentucky") %>%
filter(value_id == "UniversityOfWashington_InvvenLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(210,210,210,0.2)", line = list(color = "transparent"),
legendgroup = "Kentucky", name = "Kentucky - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, name == "Kentucky") %>% filter(value_id ==
"UniversityOfWashington_InvvenMean"), type = "scatter", mode = "lines", line = list(color = "rgb(210,210,210)"),
legendgroup = "Kentucky", name = "Kentucky - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, value_id == "UniversityOfWashington_InvvenUpper") %>%
filter(name == "Louisiana"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Louisiana", name = "Louisiana - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_invven, name == "Louisiana") %>%
filter(value_id == "UniversityOfWashington_InvvenLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(230,235,170,0.2)", line = list(color = "transparent"),
legendgroup = "Louisiana", name = "Louisiana - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, name == "Louisiana") %>% filter(value_id ==
"UniversityOfWashington_InvvenMean"), type = "scatter", mode = "lines", line = list(color = "rgb(230,235,170)"),
legendgroup = "Louisiana", name = "Louisiana - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, value_id == "UniversityOfWashington_InvvenUpper") %>%
filter(name == "Maine"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Maine", name = "Maine - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_invven, name == "Maine") %>%
filter(value_id == "UniversityOfWashington_InvvenLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(160,235,240,0.2)", line = list(color = "transparent"),
legendgroup = "Maine", name = "Maine - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, name == "Maine") %>% filter(value_id == "UniversityOfWashington_InvvenMean"),
type = "scatter", mode = "lines", line = list(color = "rgb(160,235,240)"),
legendgroup = "Maine", name = "Maine - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, value_id == "UniversityOfWashington_InvvenUpper") %>%
filter(name == "Maryland"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Maryland", name = "Maryland - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_invven, name == "Maryland") %>%
filter(value_id == "UniversityOfWashington_InvvenLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(170,205,230,0.2)", line = list(color = "transparent"),
legendgroup = "Maryland", name = "Maryland - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, name == "Maryland") %>% filter(value_id ==
"UniversityOfWashington_InvvenMean"), type = "scatter", mode = "lines", line = list(color = "rgb(170,205,230)"),
legendgroup = "Maryland", name = "Maryland - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, value_id == "UniversityOfWashington_InvvenUpper") %>%
filter(name == "Massachusetts"), x = ~dates, y = ~data, type = "scatter",
mode = "lines", line = list(color = "transparent"), legendgroup = "Massachusetts",
name = "Massachusetts - Upper Estimate", visible = "legendonly") %>% add_trace(data = filter(uw_invven,
name == "Massachusetts") %>% filter(value_id == "UniversityOfWashington_InvvenLower"),
type = "scatter", mode = "lines", fill = "tonexty", fillcolor = "rgba(255,205,160,0.2)",
line = list(color = "transparent"), legendgroup = "Massachusetts", name = "Massachusetts - Lower Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_invven, name == "Massachusetts") %>%
filter(value_id == "UniversityOfWashington_InvvenMean"), type = "scatter", mode = "lines",
line = list(color = "rgb(255,205,160)"), legendgroup = "Massachusetts", name = "Massachusetts - Mean Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_invven, value_id == "UniversityOfWashington_InvvenUpper") %>%
filter(name == "Michigan"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Michigan", name = "Michigan - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_invven, name == "Michigan") %>%
filter(value_id == "UniversityOfWashington_InvvenLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(170,225,175,0.2)", line = list(color = "transparent"),
legendgroup = "Michigan", name = "Michigan - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, name == "Michigan") %>% filter(value_id ==
"UniversityOfWashington_InvvenMean"), type = "scatter", mode = "lines", line = list(color = "rgb(170,225,175)"),
legendgroup = "Michigan", name = "Michigan - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, value_id == "UniversityOfWashington_InvvenUpper") %>%
filter(name == "Minnesota"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Minnesota", name = "Minnesota - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_invven, name == "Minnesota") %>%
filter(value_id == "UniversityOfWashington_InvvenLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(250,170,175,0.2)", line = list(color = "transparent"),
legendgroup = "Minnesota", name = "Minnesota - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, name == "Minnesota") %>% filter(value_id ==
"UniversityOfWashington_InvvenMean"), type = "scatter", mode = "lines", line = list(color = "rgb(250,170,175)"),
legendgroup = "Minnesota", name = "Minnesota - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, value_id == "UniversityOfWashington_InvvenUpper") %>%
filter(name == "Mississippi"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Mississippi", name = "Mississippi - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_invven, name == "Mississippi") %>%
filter(value_id == "UniversityOfWashington_InvvenLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(220,195,235,0.2)", line = list(color = "transparent"),
legendgroup = "Mississippi", name = "Mississippi - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, name == "Mississippi") %>% filter(value_id ==
"UniversityOfWashington_InvvenMean"), type = "scatter", mode = "lines", line = list(color = "rgb(220,195,235)"),
legendgroup = "Mississippi", name = "Mississippi - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, value_id == "UniversityOfWashington_InvvenUpper") %>%
filter(name == "Missouri"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Missouri", name = "Missouri - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_invven, name == "Missouri") %>%
filter(value_id == "UniversityOfWashington_InvvenLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(215,190,190,0.2)", line = list(color = "transparent"),
legendgroup = "Missouri", name = "Missouri - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, name == "Missouri") %>% filter(value_id ==
"UniversityOfWashington_InvvenMean"), type = "scatter", mode = "lines", line = list(color = "rgb(215,190,190)"),
legendgroup = "Missouri", name = "Missouri - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, value_id == "UniversityOfWashington_InvvenUpper") %>%
filter(name == "Montana"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Montana", name = "Montana - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_invven, name == "Montana") %>%
filter(value_id == "UniversityOfWashington_InvvenLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(250,200,235,0.2)", line = list(color = "transparent"),
legendgroup = "Montana", name = "Montana - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, name == "Montana") %>% filter(value_id ==
"UniversityOfWashington_InvvenMean"), type = "scatter", mode = "lines", line = list(color = "rgb(250,200,235)"),
legendgroup = "Montana", name = "Montana - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, value_id == "UniversityOfWashington_InvvenUpper") %>%
filter(name == "Nebraska"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Nebraska", name = "Nebraska - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_invven, name == "Nebraska") %>%
filter(value_id == "UniversityOfWashington_InvvenLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(210,210,210,0.2)", line = list(color = "transparent"),
legendgroup = "Nebraska", name = "Nebraska - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, name == "Nebraska") %>% filter(value_id ==
"UniversityOfWashington_InvvenMean"), type = "scatter", mode = "lines", line = list(color = "rgb(210,210,210)"),
legendgroup = "Nebraska", name = "Nebraska - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, value_id == "UniversityOfWashington_InvvenUpper") %>%
filter(name == "Nevada"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Nevada", name = "Nevada - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_invven, name == "Nevada") %>%
filter(value_id == "UniversityOfWashington_InvvenLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(230,235,170,0.2)", line = list(color = "transparent"),
legendgroup = "Nevada", name = "Nevada - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, name == "Nevada") %>% filter(value_id == "UniversityOfWashington_InvvenMean"),
type = "scatter", mode = "lines", line = list(color = "rgb(230,235,170)"),
legendgroup = "Nevada", name = "Nevada - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, value_id == "UniversityOfWashington_InvvenUpper") %>%
filter(name == "NewHampshire"), x = ~dates, y = ~data, type = "scatter",
mode = "lines", line = list(color = "transparent"), legendgroup = "NewHampshire",
name = "New Hampshire - Upper Estimate", visible = "legendonly") %>% add_trace(data = filter(uw_invven,
name == "NewHampshire") %>% filter(value_id == "UniversityOfWashington_InvvenLower"),
type = "scatter", mode = "lines", fill = "tonexty", fillcolor = "rgba(160,235,240,0.2)",
line = list(color = "transparent"), legendgroup = "NewHampshire", name = "New Hampshire - Lower Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_invven, name == "NewHampshire") %>%
filter(value_id == "UniversityOfWashington_InvvenMean"), type = "scatter", mode = "lines",
line = list(color = "rgb(160,235,240)"), legendgroup = "NewHampshire", name = "New Hampshire - Mean Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_invven, value_id == "UniversityOfWashington_InvvenUpper") %>%
filter(name == "NewJersey"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "NewJersey", name = "New Jersey - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_invven, name == "NewJersey") %>%
filter(value_id == "UniversityOfWashington_InvvenLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(170,205,230,0.2)", line = list(color = "transparent"),
legendgroup = "NewJersey", name = "New Jersey - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, name == "NewJersey") %>% filter(value_id ==
"UniversityOfWashington_InvvenMean"), type = "scatter", mode = "lines", line = list(color = "rgb(170,205,230)"),
legendgroup = "NewJersey", name = "New Jersey - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, value_id == "UniversityOfWashington_InvvenUpper") %>%
filter(name == "NewMexico"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "NewMexico", name = "New Mexico - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_invven, name == "NewMexico") %>%
filter(value_id == "UniversityOfWashington_InvvenLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(255,205,160,0.2)", line = list(color = "transparent"),
legendgroup = "NewMexico", name = "New Mexico - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, name == "NewMexico") %>% filter(value_id ==
"UniversityOfWashington_InvvenMean"), type = "scatter", mode = "lines", line = list(color = "rgb(255,205,160)"),
legendgroup = "NewMexico", name = "New Mexico - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, value_id == "UniversityOfWashington_InvvenUpper") %>%
filter(name == "NewYork"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "NewYork", name = "New York - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_invven, name == "NewYork") %>%
filter(value_id == "UniversityOfWashington_InvvenLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(170,225,175,0.2)", line = list(color = "transparent"),
legendgroup = "NewYork", name = "New York - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, name == "NewYork") %>% filter(value_id ==
"UniversityOfWashington_InvvenMean"), type = "scatter", mode = "lines", line = list(color = "rgb(170,225,175)"),
legendgroup = "NewYork", name = "New York - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, value_id == "UniversityOfWashington_InvvenUpper") %>%
filter(name == "NorthCarolina"), x = ~dates, y = ~data, type = "scatter",
mode = "lines", line = list(color = "transparent"), legendgroup = "NorthCarolina",
name = "North Carolina - Upper Estimate", visible = "legendonly") %>% add_trace(data = filter(uw_invven,
name == "NorthCarolina") %>% filter(value_id == "UniversityOfWashington_InvvenLower"),
type = "scatter", mode = "lines", fill = "tonexty", fillcolor = "rgba(250,170,175,0.2)",
line = list(color = "transparent"), legendgroup = "NorthCarolina", name = "North Carolina - Lower Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_invven, name == "NorthCarolina") %>%
filter(value_id == "UniversityOfWashington_InvvenMean"), type = "scatter", mode = "lines",
line = list(color = "rgb(250,170,175)"), legendgroup = "NorthCarolina", name = "North Carolina - Mean Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_invven, value_id == "UniversityOfWashington_InvvenUpper") %>%
filter(name == "NorthDakota"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "NorthDakota", name = "North Dakota - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_invven, name == "NorthDakota") %>%
filter(value_id == "UniversityOfWashington_InvvenLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(220,195,235,0.2)", line = list(color = "transparent"),
legendgroup = "NorthDakota", name = "North Dakota - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, name == "NorthDakota") %>% filter(value_id ==
"UniversityOfWashington_InvvenMean"), type = "scatter", mode = "lines", line = list(color = "rgb(220,195,235)"),
legendgroup = "NorthDakota", name = "North Dakota - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, value_id == "UniversityOfWashington_InvvenUpper") %>%
filter(name == "Ohio"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Ohio", name = "Ohio - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_invven, name == "Ohio") %>%
filter(value_id == "UniversityOfWashington_InvvenLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(215,190,190,0.2)", line = list(color = "transparent"),
legendgroup = "Ohio", name = "Ohio - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, name == "Ohio") %>% filter(value_id == "UniversityOfWashington_InvvenMean"),
type = "scatter", mode = "lines", line = list(color = "rgb(215,190,190)"),
legendgroup = "Ohio", name = "Ohio - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, value_id == "UniversityOfWashington_InvvenUpper") %>%
filter(name == "Oklahoma"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Oklahoma", name = "Oklahoma - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_invven, name == "Oklahoma") %>%
filter(value_id == "UniversityOfWashington_InvvenLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(250,200,235,0.2)", line = list(color = "transparent"),
legendgroup = "Oklahoma", name = "Oklahoma - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, name == "Oklahoma") %>% filter(value_id ==
"UniversityOfWashington_InvvenMean"), type = "scatter", mode = "lines", line = list(color = "rgb(250,200,235)"),
legendgroup = "Oklahoma", name = "Oklahoma - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, value_id == "UniversityOfWashington_InvvenUpper") %>%
filter(name == "Oregon"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Oregon", name = "Oregon - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_invven, name == "Oregon") %>%
filter(value_id == "UniversityOfWashington_InvvenLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(210,210,210,0.2)", line = list(color = "transparent"),
legendgroup = "Oregon", name = "Oregon - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, name == "Oregon") %>% filter(value_id == "UniversityOfWashington_InvvenMean"),
type = "scatter", mode = "lines", line = list(color = "rgb(210,210,210)"),
legendgroup = "Oregon", name = "Oregon - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, value_id == "UniversityOfWashington_InvvenUpper") %>%
filter(name == "Pennsylvania"), x = ~dates, y = ~data, type = "scatter",
mode = "lines", line = list(color = "transparent"), legendgroup = "Pennsylvania",
name = "Pennsylvania - Upper Estimate", visible = "legendonly") %>% add_trace(data = filter(uw_invven,
name == "Pennsylvania") %>% filter(value_id == "UniversityOfWashington_InvvenLower"),
type = "scatter", mode = "lines", fill = "tonexty", fillcolor = "rgba(230,235,170,0.2)",
line = list(color = "transparent"), legendgroup = "Pennsylvania", name = "Pennsylvania - Lower Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_invven, name == "Pennsylvania") %>%
filter(value_id == "UniversityOfWashington_InvvenMean"), type = "scatter", mode = "lines",
line = list(color = "rgb(230,235,170)"), legendgroup = "Pennsylvania", name = "Pennsylvania - Mean Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_invven, value_id == "UniversityOfWashington_InvvenUpper") %>%
filter(name == "PuertoRico"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "PuertoRico", name = "Puerto Rico - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_invven, name == "PuertoRico") %>%
filter(value_id == "UniversityOfWashington_InvvenLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(160,235,240,0.2)", line = list(color = "transparent"),
legendgroup = "PuertoRico", name = "Puerto Rico - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, name == "PuertoRico") %>% filter(value_id ==
"UniversityOfWashington_InvvenMean"), type = "scatter", mode = "lines", line = list(color = "rgb(160,235,240)"),
legendgroup = "PuertoRico", name = "Puerto Rico - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, value_id == "UniversityOfWashington_InvvenUpper") %>%
filter(name == "RhodeIsland"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "RhodeIsland", name = "Rhode Island - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_invven, name == "RhodeIsland") %>%
filter(value_id == "UniversityOfWashington_InvvenLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(170,205,230,0.2)", line = list(color = "transparent"),
legendgroup = "RhodeIsland", name = "Rhode Island - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, name == "RhodeIsland") %>% filter(value_id ==
"UniversityOfWashington_InvvenMean"), type = "scatter", mode = "lines", line = list(color = "rgb(170,205,230)"),
legendgroup = "RhodeIsland", name = "Rhode Island - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, value_id == "UniversityOfWashington_InvvenUpper") %>%
filter(name == "SouthCarolina"), x = ~dates, y = ~data, type = "scatter",
mode = "lines", line = list(color = "transparent"), legendgroup = "SouthCarolina",
name = "South Carolina - Upper Estimate", visible = "legendonly") %>% add_trace(data = filter(uw_invven,
name == "SouthCarolina") %>% filter(value_id == "UniversityOfWashington_InvvenLower"),
type = "scatter", mode = "lines", fill = "tonexty", fillcolor = "rgba(255,205,160,0.2)",
line = list(color = "transparent"), legendgroup = "SouthCarolina", name = "South Carolina - Lower Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_invven, name == "SouthCarolina") %>%
filter(value_id == "UniversityOfWashington_InvvenMean"), type = "scatter", mode = "lines",
line = list(color = "rgb(255,205,160)"), legendgroup = "SouthCarolina", name = "South Carolina - Mean Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_invven, value_id == "UniversityOfWashington_InvvenUpper") %>%
filter(name == "SouthDakota"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "SouthDakota", name = "South Dakota - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_invven, name == "SouthDakota") %>%
filter(value_id == "UniversityOfWashington_InvvenLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(170,225,175,0.2)", line = list(color = "transparent"),
legendgroup = "SouthDakota", name = "South Dakota - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, name == "SouthDakota") %>% filter(value_id ==
"UniversityOfWashington_InvvenMean"), type = "scatter", mode = "lines", line = list(color = "rgb(170,225,175)"),
legendgroup = "SouthDakota", name = "South Dakota - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, value_id == "UniversityOfWashington_InvvenUpper") %>%
filter(name == "Tennessee"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Tennessee", name = "Tennessee - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_invven, name == "Tennessee") %>%
filter(value_id == "UniversityOfWashington_InvvenLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(250,170,175,0.2)", line = list(color = "transparent"),
legendgroup = "Tennessee", name = "Tennessee - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, name == "Tennessee") %>% filter(value_id ==
"UniversityOfWashington_InvvenMean"), type = "scatter", mode = "lines", line = list(color = "rgb(250,170,175)"),
legendgroup = "Tennessee", name = "Tennessee - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, value_id == "UniversityOfWashington_InvvenUpper") %>%
filter(name == "Texas"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Texas", name = "Texas - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_invven, name == "Texas") %>%
filter(value_id == "UniversityOfWashington_InvvenLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(220,195,235,0.2)", line = list(color = "transparent"),
legendgroup = "Texas", name = "Texas - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, name == "Texas") %>% filter(value_id == "UniversityOfWashington_InvvenMean"),
type = "scatter", mode = "lines", line = list(color = "rgb(220,195,235)"),
legendgroup = "Texas", name = "Texas - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, value_id == "UniversityOfWashington_InvvenUpper") %>%
filter(name == "Utah"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Utah", name = "Utah - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_invven, name == "Utah") %>%
filter(value_id == "UniversityOfWashington_InvvenLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(215,190,190,0.2)", line = list(color = "transparent"),
legendgroup = "Utah", name = "Utah - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, name == "Utah") %>% filter(value_id == "UniversityOfWashington_InvvenMean"),
type = "scatter", mode = "lines", line = list(color = "rgb(215,190,190)"),
legendgroup = "Utah", name = "Utah - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, value_id == "UniversityOfWashington_InvvenUpper") %>%
filter(name == "Vermont"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Vermont", name = "Vermont - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_invven, name == "Vermont") %>%
filter(value_id == "UniversityOfWashington_InvvenLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(250,200,235,0.2)", line = list(color = "transparent"),
legendgroup = "Vermont", name = "Vermont - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, name == "Vermont") %>% filter(value_id ==
"UniversityOfWashington_InvvenMean"), type = "scatter", mode = "lines", line = list(color = "rgb(250,200,235)"),
legendgroup = "Vermont", name = "Vermont - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, value_id == "UniversityOfWashington_InvvenUpper") %>%
filter(name == "Virginia"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Virginia", name = "Virginia - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_invven, name == "Virginia") %>%
filter(value_id == "UniversityOfWashington_InvvenLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(210,210,210,0.2)", line = list(color = "transparent"),
legendgroup = "Virginia", name = "Virginia - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, name == "Virginia") %>% filter(value_id ==
"UniversityOfWashington_InvvenMean"), type = "scatter", mode = "lines", line = list(color = "rgb(210,210,210)"),
legendgroup = "Virginia", name = "Virginia - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, value_id == "UniversityOfWashington_InvvenUpper") %>%
filter(name == "Washington"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Washington", name = "Washington - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_invven, name == "Washington") %>%
filter(value_id == "UniversityOfWashington_InvvenLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(230,235,170,0.2)", line = list(color = "transparent"),
legendgroup = "Washington", name = "Washington - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, name == "Washington") %>% filter(value_id ==
"UniversityOfWashington_InvvenMean"), type = "scatter", mode = "lines", line = list(color = "rgb(230,235,170)"),
legendgroup = "Washington", name = "Washington - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, value_id == "UniversityOfWashington_InvvenUpper") %>%
filter(name == "WestVirginia"), x = ~dates, y = ~data, type = "scatter",
mode = "lines", line = list(color = "transparent"), legendgroup = "WestVirginia",
name = "West Virginia - Upper Estimate", visible = "legendonly") %>% add_trace(data = filter(uw_invven,
name == "WestVirginia") %>% filter(value_id == "UniversityOfWashington_InvvenLower"),
type = "scatter", mode = "lines", fill = "tonexty", fillcolor = "rgba(160,235,240,0.2)",
line = list(color = "transparent"), legendgroup = "WestVirginia", name = "West Virginia - Lower Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_invven, name == "WestVirginia") %>%
filter(value_id == "UniversityOfWashington_InvvenMean"), type = "scatter", mode = "lines",
line = list(color = "rgb(160,235,240)"), legendgroup = "WestVirginia", name = "West Virginia - Mean Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_invven, value_id == "UniversityOfWashington_InvvenUpper") %>%
filter(name == "Wisconsin"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Wisconsin", name = "Wisconsin - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_invven, name == "Wisconsin") %>%
filter(value_id == "UniversityOfWashington_InvvenLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(170,205,230,0.2)", line = list(color = "transparent"),
legendgroup = "Wisconsin", name = "Wisconsin - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, name == "Wisconsin") %>% filter(value_id ==
"UniversityOfWashington_InvvenMean"), type = "scatter", mode = "lines", line = list(color = "rgb(170,205,230)"),
legendgroup = "Wisconsin", name = "Wisconsin - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, value_id == "UniversityOfWashington_InvvenUpper") %>%
filter(name == "Wyoming"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Wyoming", name = "Wyoming - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_invven, name == "Wyoming") %>%
filter(value_id == "UniversityOfWashington_InvvenLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(255,210,165,0.2)", line = list(color = "transparent"),
legendgroup = "Wyoming", name = "Wyoming - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_invven, name == "Wyoming") %>% filter(value_id ==
"UniversityOfWashington_InvvenMean"), type = "scatter", mode = "lines", line = list(color = "rgb(255,210,165)"),
legendgroup = "Wyoming", name = "Wyoming - Mean Estimate", visible = "legendonly") %>%
layout(title = "Mean, Upper and Lower Estimates for Invasive Ventilations Needed per Day",
paper_bgcolor = "rgb(200,200,200)", plot_bgcolor = "rgb(150,150,150)", xaxis = list(title = "Date",
gridcolor = "rgb(255,255,255)", showgrid = TRUE, showline = FALSE, showticklabels = TRUE,
tickcolor = "rgb(127,127,127)", ticks = "outside", zeroline = FALSE),
yaxis = list(title = "Procedures Needed", gridcolor = "rgb(255,255,255)",
showgrid = TRUE, showline = FALSE, showticklabels = TRUE, tickcolor = "rgb(127,127,127)",
ticks = "outside", zeroline = FALSE), margin = list(l = 80, r = 80, b = 75,
t = 100, pad = 4))
Hospital Beds Needed for COVID
uw_beds <- uw_estimates %>% mutate(name = name %>% str_remove("_UnitedStates")) %>%
filter(value_id %in% c("UniversityOfWashington_AllbedMean", "UniversityOfWashington_AllbedLower",
"UniversityOfWashington_AllbedUpper"), missing == 0)
plot_ly(filter(uw_beds, value_id == "UniversityOfWashington_AllbedUpper") %>% filter(name ==
"Hawaii"), x = ~dates, y = ~data, type = "scatter", mode = "lines", line = list(color = "transparent"),
legendgroup = "Hawaii", name = "Hawaii - Upper Estimate") %>% add_trace(data = filter(uw_beds,
name == "Hawaii") %>% filter(value_id == "UniversityOfWashington_AllbedLower"),
type = "scatter", mode = "lines", fill = "tonexty", fillcolor = "rgba(0,100,170,0.2)",
line = list(color = "transparent"), legendgroup = "Hawaii", name = "Hawaii - Lower Estimate") %>%
add_trace(data = filter(uw_beds, name == "Hawaii") %>% filter(value_id == "UniversityOfWashington_AllbedMean"),
type = "scatter", mode = "lines", line = list(color = "rgb(0,100,170)"),
legendgroup = "Hawaii", name = "Hawaii - Mean Estimate") %>% add_trace(data = filter(uw_beds,
value_id == "UniversityOfWashington_AllbedUpper") %>% filter(name == "Alabama"),
x = ~dates, y = ~data, type = "scatter", mode = "lines", line = list(color = "transparent"),
legendgroup = "Alabama", name = "Alabama - Upper Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, name == "Alabama") %>% filter(value_id == "UniversityOfWashington_AllbedLower"),
type = "scatter", mode = "lines", fill = "tonexty", fillcolor = "rgba(255,205,160,0.2)",
line = list(color = "transparent"), legendgroup = "Alabama", name = "Alabama - Lower Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_beds, name == "Alabama") %>%
filter(value_id == "UniversityOfWashington_AllbedMean"), type = "scatter", mode = "lines",
line = list(color = "rgb(255,205,160)"), legendgroup = "Alabama", name = "Alabama - Mean Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_beds, value_id == "UniversityOfWashington_AllbedUpper") %>%
filter(name == "Alaska"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Alaska", name = "Alaska - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_beds, name == "Alaska") %>%
filter(value_id == "UniversityOfWashington_AllbedLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(170,225,175,0.2)", line = list(color = "transparent"),
legendgroup = "Alaska", name = "Alaska - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, name == "Alaska") %>% filter(value_id == "UniversityOfWashington_AllbedMean"),
type = "scatter", mode = "lines", line = list(color = "rgb(170,225,175)"),
legendgroup = "Alaska", name = "Alaska - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, value_id == "UniversityOfWashington_AllbedUpper") %>%
filter(name == "Arizona"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Arizona", name = "Arizona - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_beds, name == "Arizona") %>%
filter(value_id == "UniversityOfWashington_AllbedLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(250,170,175,0.2)", line = list(color = "transparent"),
legendgroup = "Arizona", name = "Arizona - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, name == "Arizona") %>% filter(value_id == "UniversityOfWashington_AllbedMean"),
type = "scatter", mode = "lines", line = list(color = "rgb(250,170,175)"),
legendgroup = "Arizona", name = "Arizona - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, value_id == "UniversityOfWashington_AllbedUpper") %>%
filter(name == "Arkansas"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Arkansas", name = "Arkansas - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_beds, name == "Arkansas") %>%
filter(value_id == "UniversityOfWashington_AllbedLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(220,195,235,0.2)", line = list(color = "transparent"),
legendgroup = "Arkansas", name = "Arkansas - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, name == "Arkansas") %>% filter(value_id == "UniversityOfWashington_AllbedMean"),
type = "scatter", mode = "lines", line = list(color = "rgb(220,195,235)"),
legendgroup = "Arkansas", name = "Arkansas - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, value_id == "UniversityOfWashington_AllbedUpper") %>%
filter(name == "California"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "California", name = "California - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_beds, name == "California") %>%
filter(value_id == "UniversityOfWashington_AllbedLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(215,190,190,0.2)", line = list(color = "transparent"),
legendgroup = "California", name = "California - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, name == "California") %>% filter(value_id ==
"UniversityOfWashington_AllbedMean"), type = "scatter", mode = "lines", line = list(color = "rgb(215,190,190)"),
legendgroup = "California", name = "California - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, value_id == "UniversityOfWashington_AllbedUpper") %>%
filter(name == "Colorado"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Colorado", name = "Colorado - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_beds, name == "Colorado") %>%
filter(value_id == "UniversityOfWashington_AllbedLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(250,200,235,0.2)", line = list(color = "transparent"),
legendgroup = "Colorado", name = "Colorado - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, name == "Colorado") %>% filter(value_id == "UniversityOfWashington_AllbedMean"),
type = "scatter", mode = "lines", line = list(color = "rgb(250,200,235)"),
legendgroup = "Colorado", name = "Colorado - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, value_id == "UniversityOfWashington_AllbedUpper") %>%
filter(name == "Connecticut"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Connecticut", name = "Connecticut - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_beds, name == "Connecticut") %>%
filter(value_id == "UniversityOfWashington_AllbedLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(210,210,210,0.2)", line = list(color = "transparent"),
legendgroup = "Connecticut", name = "Connecticut - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, name == "Connecticut") %>% filter(value_id ==
"UniversityOfWashington_AllbedMean"), type = "scatter", mode = "lines", line = list(color = "rgb(210,210,210)"),
legendgroup = "Connecticut", name = "Connecticut - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, value_id == "UniversityOfWashington_AllbedUpper") %>%
filter(name == "Delaware"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Delaware", name = "Delaware - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_beds, name == "Delaware") %>%
filter(value_id == "UniversityOfWashington_AllbedLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(230,230,170,0.2)", line = list(color = "transparent"),
legendgroup = "Delaware", name = "Delaware - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, name == "Delaware") %>% filter(value_id == "UniversityOfWashington_AllbedMean"),
type = "scatter", mode = "lines", line = list(color = "rgb(230,230,170)"),
legendgroup = "Delaware", name = "Delaware - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, value_id == "UniversityOfWashington_AllbedUpper") %>%
filter(name == "DistrictofColumbia"), x = ~dates, y = ~data, type = "scatter",
mode = "lines", line = list(color = "transparent"), legendgroup = "DistrictofColumbia",
name = "District of Columbia - Upper Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, name == "DistrictofColumbia") %>% filter(value_id ==
"UniversityOfWashington_AllbedLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(160,235,240,0.2)", line = list(color = "transparent"),
legendgroup = "DistrictofColumbia", name = "District of Columbia - Lower Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_beds, name == "DistrictofColumbia") %>%
filter(value_id == "UniversityOfWashington_AllbedMean"), type = "scatter", mode = "lines",
line = list(color = "rgb(160,235,240)"), legendgroup = "DistrictofColumbia",
name = "District of Columbia - Mean Estimate", visible = "legendonly") %>% add_trace(data = filter(uw_beds,
value_id == "UniversityOfWashington_AllbedUpper") %>% filter(name == "Florida"),
x = ~dates, y = ~data, type = "scatter", mode = "lines", line = list(color = "transparent"),
legendgroup = "Florida", name = "Florida - Upper Estimate") %>% add_trace(data = filter(uw_beds,
name == "Florida") %>% filter(value_id == "UniversityOfWashington_AllbedLower"),
type = "scatter", mode = "lines", fill = "tonexty", fillcolor = "rgba(170,205,230,0.2)",
line = list(color = "transparent"), legendgroup = "Florida", name = "Florida - Lower Estimate") %>%
add_trace(data = filter(uw_beds, name == "Florida") %>% filter(value_id == "UniversityOfWashington_AllbedMean"),
type = "scatter", mode = "lines", line = list(color = "rgb(170,205,230)"),
legendgroup = "Florida", name = "Florida - Mean Estimate") %>% add_trace(data = filter(uw_beds,
value_id == "UniversityOfWashington_AllbedUpper") %>% filter(name == "Georgia"),
x = ~dates, y = ~data, type = "scatter", mode = "lines", line = list(color = "transparent"),
legendgroup = "Georgia", name = "Georgia - Upper Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, name == "Georgia") %>% filter(value_id == "UniversityOfWashington_AllbedLower"),
type = "scatter", mode = "lines", fill = "tonexty", fillcolor = "rgba(255,205,160,0.2)",
line = list(color = "transparent"), legendgroup = "Georgia", name = "Georgia - Lower Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_beds, name == "Georgia") %>%
filter(value_id == "UniversityOfWashington_AllbedMean"), type = "scatter", mode = "lines",
line = list(color = "rgb(255,205,160)"), legendgroup = "Georgia", name = "Georgia - Mean Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_beds, value_id == "UniversityOfWashington_AllbedUpper") %>%
filter(name == "Idaho"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Idaho", name = "Idaho - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_beds, name == "Idaho") %>%
filter(value_id == "UniversityOfWashington_AllbedLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(170,225,175,0.2)", line = list(color = "transparent"),
legendgroup = "Idaho", name = "Idaho - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, name == "Idaho") %>% filter(value_id == "UniversityOfWashington_AllbedMean"),
type = "scatter", mode = "lines", line = list(color = "rgb(170,225,175)"),
legendgroup = "Idaho", name = "Idaho - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, value_id == "UniversityOfWashington_AllbedUpper") %>%
filter(name == "Illinois"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Illinois", name = "Illinois - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_beds, name == "Illinois") %>%
filter(value_id == "UniversityOfWashington_AllbedLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(250,175,180,0.2)", line = list(color = "transparent"),
legendgroup = "Illinois", name = "Illinois - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, name == "Illinois") %>% filter(value_id == "UniversityOfWashington_AllbedMean"),
type = "scatter", mode = "lines", line = list(color = "rgb(250,175,180)"),
legendgroup = "Illinois", name = "Illinois - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, value_id == "UniversityOfWashington_AllbedUpper") %>%
filter(name == "Indiana"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Indiana", name = "Indiana - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_beds, name == "Indiana") %>%
filter(value_id == "UniversityOfWashington_AllbedLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(220,195,235,0.2)", line = list(color = "transparent"),
legendgroup = "Indiana", name = "Indiana - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, name == "Indiana") %>% filter(value_id == "UniversityOfWashington_AllbedMean"),
type = "scatter", mode = "lines", line = list(color = "rgb(220,195,235)"),
legendgroup = "Indiana", name = "Indiana - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, value_id == "UniversityOfWashington_AllbedUpper") %>%
filter(name == "Iowa"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Iowa", name = "Iowa - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_beds, name == "Iowa") %>%
filter(value_id == "UniversityOfWashington_AllbedLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(215,190,190,0.2)", line = list(color = "transparent"),
legendgroup = "Iowa", name = "Iowa - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, name == "Iowa") %>% filter(value_id == "UniversityOfWashington_AllbedMean"),
type = "scatter", mode = "lines", line = list(color = "rgb(215,190,190)"),
legendgroup = "Iowa", name = "Iowa - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, value_id == "UniversityOfWashington_AllbedUpper") %>%
filter(name == "Kansas"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Kansas", name = "Kansas - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_beds, name == "Kansas") %>%
filter(value_id == "UniversityOfWashington_AllbedLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(250,200,235,0.2)", line = list(color = "transparent"),
legendgroup = "Kansas", name = "Kansas - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, name == "Kansas") %>% filter(value_id == "UniversityOfWashington_AllbedMean"),
type = "scatter", mode = "lines", line = list(color = "rgb(250,200,235)"),
legendgroup = "Kansas", name = "Kansas - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, value_id == "UniversityOfWashington_AllbedUpper") %>%
filter(name == "Kentucky"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Kentucky", name = "Kentucky - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_beds, name == "Kentucky") %>%
filter(value_id == "UniversityOfWashington_AllbedLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(210,210,210,0.2)", line = list(color = "transparent"),
legendgroup = "Kentucky", name = "Kentucky - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, name == "Kentucky") %>% filter(value_id == "UniversityOfWashington_AllbedMean"),
type = "scatter", mode = "lines", line = list(color = "rgb(210,210,210)"),
legendgroup = "Kentucky", name = "Kentucky - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, value_id == "UniversityOfWashington_AllbedUpper") %>%
filter(name == "Louisiana"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Louisiana", name = "Louisiana - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_beds, name == "Louisiana") %>%
filter(value_id == "UniversityOfWashington_AllbedLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(230,235,170,0.2)", line = list(color = "transparent"),
legendgroup = "Louisiana", name = "Louisiana - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, name == "Louisiana") %>% filter(value_id ==
"UniversityOfWashington_AllbedMean"), type = "scatter", mode = "lines", line = list(color = "rgb(230,235,170)"),
legendgroup = "Louisiana", name = "Louisiana - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, value_id == "UniversityOfWashington_AllbedUpper") %>%
filter(name == "Maine"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Maine", name = "Maine - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_beds, name == "Maine") %>%
filter(value_id == "UniversityOfWashington_AllbedLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(160,235,240,0.2)", line = list(color = "transparent"),
legendgroup = "Maine", name = "Maine - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, name == "Maine") %>% filter(value_id == "UniversityOfWashington_AllbedMean"),
type = "scatter", mode = "lines", line = list(color = "rgb(160,235,240)"),
legendgroup = "Maine", name = "Maine - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, value_id == "UniversityOfWashington_AllbedUpper") %>%
filter(name == "Maryland"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Maryland", name = "Maryland - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_beds, name == "Maryland") %>%
filter(value_id == "UniversityOfWashington_AllbedLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(170,205,230,0.2)", line = list(color = "transparent"),
legendgroup = "Maryland", name = "Maryland - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, name == "Maryland") %>% filter(value_id == "UniversityOfWashington_AllbedMean"),
type = "scatter", mode = "lines", line = list(color = "rgb(170,205,230)"),
legendgroup = "Maryland", name = "Maryland - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, value_id == "UniversityOfWashington_AllbedUpper") %>%
filter(name == "Massachusetts"), x = ~dates, y = ~data, type = "scatter",
mode = "lines", line = list(color = "transparent"), legendgroup = "Massachusetts",
name = "Massachusetts - Upper Estimate", visible = "legendonly") %>% add_trace(data = filter(uw_beds,
name == "Massachusetts") %>% filter(value_id == "UniversityOfWashington_AllbedLower"),
type = "scatter", mode = "lines", fill = "tonexty", fillcolor = "rgba(255,205,160,0.2)",
line = list(color = "transparent"), legendgroup = "Massachusetts", name = "Massachusetts - Lower Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_beds, name == "Massachusetts") %>%
filter(value_id == "UniversityOfWashington_AllbedMean"), type = "scatter", mode = "lines",
line = list(color = "rgb(255,205,160)"), legendgroup = "Massachusetts", name = "Massachusetts - Mean Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_beds, value_id == "UniversityOfWashington_AllbedUpper") %>%
filter(name == "Michigan"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Michigan", name = "Michigan - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_beds, name == "Michigan") %>%
filter(value_id == "UniversityOfWashington_AllbedLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(170,225,175,0.2)", line = list(color = "transparent"),
legendgroup = "Michigan", name = "Michigan - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, name == "Michigan") %>% filter(value_id == "UniversityOfWashington_AllbedMean"),
type = "scatter", mode = "lines", line = list(color = "rgb(170,225,175)"),
legendgroup = "Michigan", name = "Michigan - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, value_id == "UniversityOfWashington_AllbedUpper") %>%
filter(name == "Minnesota"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Minnesota", name = "Minnesota - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_beds, name == "Minnesota") %>%
filter(value_id == "UniversityOfWashington_AllbedLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(250,170,175,0.2)", line = list(color = "transparent"),
legendgroup = "Minnesota", name = "Minnesota - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, name == "Minnesota") %>% filter(value_id ==
"UniversityOfWashington_AllbedMean"), type = "scatter", mode = "lines", line = list(color = "rgb(250,170,175)"),
legendgroup = "Minnesota", name = "Minnesota - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, value_id == "UniversityOfWashington_AllbedUpper") %>%
filter(name == "Mississippi"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Mississippi", name = "Mississippi - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_beds, name == "Mississippi") %>%
filter(value_id == "UniversityOfWashington_AllbedLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(220,195,235,0.2)", line = list(color = "transparent"),
legendgroup = "Mississippi", name = "Mississippi - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, name == "Mississippi") %>% filter(value_id ==
"UniversityOfWashington_AllbedMean"), type = "scatter", mode = "lines", line = list(color = "rgb(220,195,235)"),
legendgroup = "Mississippi", name = "Mississippi - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, value_id == "UniversityOfWashington_AllbedUpper") %>%
filter(name == "Missouri"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Missouri", name = "Missouri - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_beds, name == "Missouri") %>%
filter(value_id == "UniversityOfWashington_AllbedLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(215,190,190,0.2)", line = list(color = "transparent"),
legendgroup = "Missouri", name = "Missouri - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, name == "Missouri") %>% filter(value_id == "UniversityOfWashington_AllbedMean"),
type = "scatter", mode = "lines", line = list(color = "rgb(215,190,190)"),
legendgroup = "Missouri", name = "Missouri - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, value_id == "UniversityOfWashington_AllbedUpper") %>%
filter(name == "Montana"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Montana", name = "Montana - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_beds, name == "Montana") %>%
filter(value_id == "UniversityOfWashington_AllbedLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(250,200,235,0.2)", line = list(color = "transparent"),
legendgroup = "Montana", name = "Montana - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, name == "Montana") %>% filter(value_id == "UniversityOfWashington_AllbedMean"),
type = "scatter", mode = "lines", line = list(color = "rgb(250,200,235)"),
legendgroup = "Montana", name = "Montana - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, value_id == "UniversityOfWashington_AllbedUpper") %>%
filter(name == "Nebraska"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Nebraska", name = "Nebraska - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_beds, name == "Nebraska") %>%
filter(value_id == "UniversityOfWashington_AllbedLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(210,210,210,0.2)", line = list(color = "transparent"),
legendgroup = "Nebraska", name = "Nebraska - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, name == "Nebraska") %>% filter(value_id == "UniversityOfWashington_AllbedMean"),
type = "scatter", mode = "lines", line = list(color = "rgb(210,210,210)"),
legendgroup = "Nebraska", name = "Nebraska - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, value_id == "UniversityOfWashington_AllbedUpper") %>%
filter(name == "Nevada"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Nevada", name = "Nevada - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_beds, name == "Nevada") %>%
filter(value_id == "UniversityOfWashington_AllbedLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(230,235,170,0.2)", line = list(color = "transparent"),
legendgroup = "Nevada", name = "Nevada - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, name == "Nevada") %>% filter(value_id == "UniversityOfWashington_AllbedMean"),
type = "scatter", mode = "lines", line = list(color = "rgb(230,235,170)"),
legendgroup = "Nevada", name = "Nevada - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, value_id == "UniversityOfWashington_AllbedUpper") %>%
filter(name == "NewHampshire"), x = ~dates, y = ~data, type = "scatter",
mode = "lines", line = list(color = "transparent"), legendgroup = "NewHampshire",
name = "New Hampshire - Upper Estimate", visible = "legendonly") %>% add_trace(data = filter(uw_beds,
name == "NewHampshire") %>% filter(value_id == "UniversityOfWashington_AllbedLower"),
type = "scatter", mode = "lines", fill = "tonexty", fillcolor = "rgba(160,235,240,0.2)",
line = list(color = "transparent"), legendgroup = "NewHampshire", name = "New Hampshire - Lower Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_beds, name == "NewHampshire") %>%
filter(value_id == "UniversityOfWashington_AllbedMean"), type = "scatter", mode = "lines",
line = list(color = "rgb(160,235,240)"), legendgroup = "NewHampshire", name = "New Hampshire - Mean Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_beds, value_id == "UniversityOfWashington_AllbedUpper") %>%
filter(name == "NewJersey"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "NewJersey", name = "New Jersey - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_beds, name == "NewJersey") %>%
filter(value_id == "UniversityOfWashington_AllbedLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(170,205,230,0.2)", line = list(color = "transparent"),
legendgroup = "NewJersey", name = "New Jersey - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, name == "NewJersey") %>% filter(value_id ==
"UniversityOfWashington_AllbedMean"), type = "scatter", mode = "lines", line = list(color = "rgb(170,205,230)"),
legendgroup = "NewJersey", name = "New Jersey - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, value_id == "UniversityOfWashington_AllbedUpper") %>%
filter(name == "NewMexico"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "NewMexico", name = "New Mexico - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_beds, name == "NewMexico") %>%
filter(value_id == "UniversityOfWashington_AllbedLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(255,205,160,0.2)", line = list(color = "transparent"),
legendgroup = "NewMexico", name = "New Mexico - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, name == "NewMexico") %>% filter(value_id ==
"UniversityOfWashington_AllbedMean"), type = "scatter", mode = "lines", line = list(color = "rgb(255,205,160)"),
legendgroup = "NewMexico", name = "New Mexico - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, value_id == "UniversityOfWashington_AllbedUpper") %>%
filter(name == "NewYork"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "NewYork", name = "New York - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_beds, name == "NewYork") %>%
filter(value_id == "UniversityOfWashington_AllbedLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(170,225,175,0.2)", line = list(color = "transparent"),
legendgroup = "NewYork", name = "New York - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, name == "NewYork") %>% filter(value_id == "UniversityOfWashington_AllbedMean"),
type = "scatter", mode = "lines", line = list(color = "rgb(170,225,175)"),
legendgroup = "NewYork", name = "New York - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, value_id == "UniversityOfWashington_AllbedUpper") %>%
filter(name == "NorthCarolina"), x = ~dates, y = ~data, type = "scatter",
mode = "lines", line = list(color = "transparent"), legendgroup = "NorthCarolina",
name = "North Carolina - Upper Estimate", visible = "legendonly") %>% add_trace(data = filter(uw_beds,
name == "NorthCarolina") %>% filter(value_id == "UniversityOfWashington_AllbedLower"),
type = "scatter", mode = "lines", fill = "tonexty", fillcolor = "rgba(250,170,175,0.2)",
line = list(color = "transparent"), legendgroup = "NorthCarolina", name = "North Carolina - Lower Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_beds, name == "NorthCarolina") %>%
filter(value_id == "UniversityOfWashington_AllbedMean"), type = "scatter", mode = "lines",
line = list(color = "rgb(250,170,175)"), legendgroup = "NorthCarolina", name = "North Carolina - Mean Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_beds, value_id == "UniversityOfWashington_AllbedUpper") %>%
filter(name == "NorthDakota"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "NorthDakota", name = "North Dakota - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_beds, name == "NorthDakota") %>%
filter(value_id == "UniversityOfWashington_AllbedLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(220,195,235,0.2)", line = list(color = "transparent"),
legendgroup = "NorthDakota", name = "North Dakota - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, name == "NorthDakota") %>% filter(value_id ==
"UniversityOfWashington_AllbedMean"), type = "scatter", mode = "lines", line = list(color = "rgb(220,195,235)"),
legendgroup = "NorthDakota", name = "North Dakota - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, value_id == "UniversityOfWashington_AllbedUpper") %>%
filter(name == "Ohio"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Ohio", name = "Ohio - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_beds, name == "Ohio") %>%
filter(value_id == "UniversityOfWashington_AllbedLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(215,190,190,0.2)", line = list(color = "transparent"),
legendgroup = "Ohio", name = "Ohio - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, name == "Ohio") %>% filter(value_id == "UniversityOfWashington_AllbedMean"),
type = "scatter", mode = "lines", line = list(color = "rgb(215,190,190)"),
legendgroup = "Ohio", name = "Ohio - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, value_id == "UniversityOfWashington_AllbedUpper") %>%
filter(name == "Oklahoma"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Oklahoma", name = "Oklahoma - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_beds, name == "Oklahoma") %>%
filter(value_id == "UniversityOfWashington_AllbedLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(250,200,235,0.2)", line = list(color = "transparent"),
legendgroup = "Oklahoma", name = "Oklahoma - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, name == "Oklahoma") %>% filter(value_id == "UniversityOfWashington_AllbedMean"),
type = "scatter", mode = "lines", line = list(color = "rgb(250,200,235)"),
legendgroup = "Oklahoma", name = "Oklahoma - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, value_id == "UniversityOfWashington_AllbedUpper") %>%
filter(name == "Oregon"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Oregon", name = "Oregon - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_beds, name == "Oregon") %>%
filter(value_id == "UniversityOfWashington_AllbedLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(210,210,210,0.2)", line = list(color = "transparent"),
legendgroup = "Oregon", name = "Oregon - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, name == "Oregon") %>% filter(value_id == "UniversityOfWashington_AllbedMean"),
type = "scatter", mode = "lines", line = list(color = "rgb(210,210,210)"),
legendgroup = "Oregon", name = "Oregon - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, value_id == "UniversityOfWashington_AllbedUpper") %>%
filter(name == "Pennsylvania"), x = ~dates, y = ~data, type = "scatter",
mode = "lines", line = list(color = "transparent"), legendgroup = "Pennsylvania",
name = "Pennsylvania - Upper Estimate", visible = "legendonly") %>% add_trace(data = filter(uw_beds,
name == "Pennsylvania") %>% filter(value_id == "UniversityOfWashington_AllbedLower"),
type = "scatter", mode = "lines", fill = "tonexty", fillcolor = "rgba(230,235,170,0.2)",
line = list(color = "transparent"), legendgroup = "Pennsylvania", name = "Pennsylvania - Lower Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_beds, name == "Pennsylvania") %>%
filter(value_id == "UniversityOfWashington_AllbedMean"), type = "scatter", mode = "lines",
line = list(color = "rgb(230,235,170)"), legendgroup = "Pennsylvania", name = "Pennsylvania - Mean Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_beds, value_id == "UniversityOfWashington_AllbedUpper") %>%
filter(name == "PuertoRico"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "PuertoRico", name = "Puerto Rico - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_beds, name == "PuertoRico") %>%
filter(value_id == "UniversityOfWashington_AllbedLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(160,235,240,0.2)", line = list(color = "transparent"),
legendgroup = "PuertoRico", name = "Puerto Rico - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, name == "PuertoRico") %>% filter(value_id ==
"UniversityOfWashington_AllbedMean"), type = "scatter", mode = "lines", line = list(color = "rgb(160,235,240)"),
legendgroup = "PuertoRico", name = "Puerto Rico - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, value_id == "UniversityOfWashington_AllbedUpper") %>%
filter(name == "RhodeIsland"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "RhodeIsland", name = "Rhode Island - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_beds, name == "RhodeIsland") %>%
filter(value_id == "UniversityOfWashington_AllbedLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(170,205,230,0.2)", line = list(color = "transparent"),
legendgroup = "RhodeIsland", name = "Rhode Island - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, name == "RhodeIsland") %>% filter(value_id ==
"UniversityOfWashington_AllbedMean"), type = "scatter", mode = "lines", line = list(color = "rgb(170,205,230)"),
legendgroup = "RhodeIsland", name = "Rhode Island - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, value_id == "UniversityOfWashington_AllbedUpper") %>%
filter(name == "SouthCarolina"), x = ~dates, y = ~data, type = "scatter",
mode = "lines", line = list(color = "transparent"), legendgroup = "SouthCarolina",
name = "South Carolina - Upper Estimate", visible = "legendonly") %>% add_trace(data = filter(uw_beds,
name == "SouthCarolina") %>% filter(value_id == "UniversityOfWashington_AllbedLower"),
type = "scatter", mode = "lines", fill = "tonexty", fillcolor = "rgba(255,205,160,0.2)",
line = list(color = "transparent"), legendgroup = "SouthCarolina", name = "South Carolina - Lower Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_beds, name == "SouthCarolina") %>%
filter(value_id == "UniversityOfWashington_AllbedMean"), type = "scatter", mode = "lines",
line = list(color = "rgb(255,205,160)"), legendgroup = "SouthCarolina", name = "South Carolina - Mean Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_beds, value_id == "UniversityOfWashington_AllbedUpper") %>%
filter(name == "SouthDakota"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "SouthDakota", name = "South Dakota - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_beds, name == "SouthDakota") %>%
filter(value_id == "UniversityOfWashington_AllbedLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(170,225,175,0.2)", line = list(color = "transparent"),
legendgroup = "SouthDakota", name = "South Dakota - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, name == "SouthDakota") %>% filter(value_id ==
"UniversityOfWashington_AllbedMean"), type = "scatter", mode = "lines", line = list(color = "rgb(170,225,175)"),
legendgroup = "SouthDakota", name = "South Dakota - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, value_id == "UniversityOfWashington_AllbedUpper") %>%
filter(name == "Tennessee"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Tennessee", name = "Tennessee - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_beds, name == "Tennessee") %>%
filter(value_id == "UniversityOfWashington_AllbedLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(250,170,175,0.2)", line = list(color = "transparent"),
legendgroup = "Tennessee", name = "Tennessee - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, name == "Tennessee") %>% filter(value_id ==
"UniversityOfWashington_AllbedMean"), type = "scatter", mode = "lines", line = list(color = "rgb(250,170,175)"),
legendgroup = "Tennessee", name = "Tennessee - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, value_id == "UniversityOfWashington_AllbedUpper") %>%
filter(name == "Texas"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Texas", name = "Texas - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_beds, name == "Texas") %>%
filter(value_id == "UniversityOfWashington_AllbedLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(220,195,235,0.2)", line = list(color = "transparent"),
legendgroup = "Texas", name = "Texas - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, name == "Texas") %>% filter(value_id == "UniversityOfWashington_AllbedMean"),
type = "scatter", mode = "lines", line = list(color = "rgb(220,195,235)"),
legendgroup = "Texas", name = "Texas - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, value_id == "UniversityOfWashington_AllbedUpper") %>%
filter(name == "Utah"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Utah", name = "Utah - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_beds, name == "Utah") %>%
filter(value_id == "UniversityOfWashington_AllbedLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(215,190,190,0.2)", line = list(color = "transparent"),
legendgroup = "Utah", name = "Utah - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, name == "Utah") %>% filter(value_id == "UniversityOfWashington_AllbedMean"),
type = "scatter", mode = "lines", line = list(color = "rgb(215,190,190)"),
legendgroup = "Utah", name = "Utah - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, value_id == "UniversityOfWashington_AllbedUpper") %>%
filter(name == "Vermont"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Vermont", name = "Vermont - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_beds, name == "Vermont") %>%
filter(value_id == "UniversityOfWashington_AllbedLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(250,200,235,0.2)", line = list(color = "transparent"),
legendgroup = "Vermont", name = "Vermont - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, name == "Vermont") %>% filter(value_id == "UniversityOfWashington_AllbedMean"),
type = "scatter", mode = "lines", line = list(color = "rgb(250,200,235)"),
legendgroup = "Vermont", name = "Vermont - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, value_id == "UniversityOfWashington_AllbedUpper") %>%
filter(name == "Virginia"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Virginia", name = "Virginia - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_beds, name == "Virginia") %>%
filter(value_id == "UniversityOfWashington_AllbedLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(210,210,210,0.2)", line = list(color = "transparent"),
legendgroup = "Virginia", name = "Virginia - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, name == "Virginia") %>% filter(value_id == "UniversityOfWashington_AllbedMean"),
type = "scatter", mode = "lines", line = list(color = "rgb(210,210,210)"),
legendgroup = "Virginia", name = "Virginia - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, value_id == "UniversityOfWashington_AllbedUpper") %>%
filter(name == "Washington"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Washington", name = "Washington - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_beds, name == "Washington") %>%
filter(value_id == "UniversityOfWashington_AllbedLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(230,235,170,0.2)", line = list(color = "transparent"),
legendgroup = "Washington", name = "Washington - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, name == "Washington") %>% filter(value_id ==
"UniversityOfWashington_AllbedMean"), type = "scatter", mode = "lines", line = list(color = "rgb(230,235,170)"),
legendgroup = "Washington", name = "Washington - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, value_id == "UniversityOfWashington_AllbedUpper") %>%
filter(name == "WestVirginia"), x = ~dates, y = ~data, type = "scatter",
mode = "lines", line = list(color = "transparent"), legendgroup = "WestVirginia",
name = "West Virginia - Upper Estimate", visible = "legendonly") %>% add_trace(data = filter(uw_beds,
name == "WestVirginia") %>% filter(value_id == "UniversityOfWashington_AllbedLower"),
type = "scatter", mode = "lines", fill = "tonexty", fillcolor = "rgba(160,235,240,0.2)",
line = list(color = "transparent"), legendgroup = "WestVirginia", name = "West Virginia - Lower Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_beds, name == "WestVirginia") %>%
filter(value_id == "UniversityOfWashington_AllbedMean"), type = "scatter", mode = "lines",
line = list(color = "rgb(160,235,240)"), legendgroup = "WestVirginia", name = "West Virginia - Mean Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_beds, value_id == "UniversityOfWashington_AllbedUpper") %>%
filter(name == "Wisconsin"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Wisconsin", name = "Wisconsin - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_beds, name == "Wisconsin") %>%
filter(value_id == "UniversityOfWashington_AllbedLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(170,205,230,0.2)", line = list(color = "transparent"),
legendgroup = "Wisconsin", name = "Wisconsin - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, name == "Wisconsin") %>% filter(value_id ==
"UniversityOfWashington_AllbedMean"), type = "scatter", mode = "lines", line = list(color = "rgb(170,205,230)"),
legendgroup = "Wisconsin", name = "Wisconsin - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, value_id == "UniversityOfWashington_AllbedUpper") %>%
filter(name == "Wyoming"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Wyoming", name = "Wyoming - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_beds, name == "Wyoming") %>%
filter(value_id == "UniversityOfWashington_AllbedLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(255,210,165,0.2)", line = list(color = "transparent"),
legendgroup = "Wyoming", name = "Wyoming - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_beds, name == "Wyoming") %>% filter(value_id == "UniversityOfWashington_AllbedMean"),
type = "scatter", mode = "lines", line = list(color = "rgb(255,210,165)"),
legendgroup = "Wyoming", name = "Wyoming - Mean Estimate", visible = "legendonly") %>%
layout(title = "Mean, Upper and Lower Estimates for Hospital Beds Needed for COVID per Day",
paper_bgcolor = "rgb(200,200,200)", plot_bgcolor = "rgb(150,150,150)", xaxis = list(title = "Date",
gridcolor = "rgb(255,255,255)", showgrid = TRUE, showline = FALSE, showticklabels = TRUE,
tickcolor = "rgb(127,127,127)", ticks = "outside", zeroline = FALSE),
yaxis = list(title = "Hospital Beds Needed", gridcolor = "rgb(255,255,255)",
showgrid = TRUE, showline = FALSE, showticklabels = TRUE, tickcolor = "rgb(127,127,127)",
ticks = "outside", zeroline = FALSE), margin = list(l = 80, r = 80, b = 75,
t = 100, pad = 4))
Shortage of Intensive Care Unit Beds for COVID-19 per Day
ICU bed shortages are computed as:
Shortage = Number of COVID-19 beds needed per day - Total ICU bed capacity - Average ICU bed use
uw_icuover <- uw_estimates %>% mutate(name = name %>% str_remove("_UnitedStates")) %>%
filter(value_id %in% c("UniversityOfWashington_IcuoverMean", "UniversityOfWashington_IcuoverLower",
"UniversityOfWashington_IcuoverUpper"), missing == 0)
plot_ly(filter(uw_icuover, value_id == "UniversityOfWashington_IcuoverUpper") %>%
filter(name == "Hawaii"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Hawaii", name = "Hawaii - Upper Estimate") %>%
add_trace(data = filter(uw_icuover, name == "Hawaii") %>% filter(value_id ==
"UniversityOfWashington_IcuoverLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(0,100,170,0.2)", line = list(color = "transparent"),
legendgroup = "Hawaii", name = "Hawaii - Lower Estimate") %>% add_trace(data = filter(uw_icuover,
name == "Hawaii") %>% filter(value_id == "UniversityOfWashington_IcuoverMean"),
type = "scatter", mode = "lines", line = list(color = "rgb(0,100,170)"), legendgroup = "Hawaii",
name = "Hawaii - Mean Estimate") %>% add_trace(data = filter(uw_icuover, value_id ==
"UniversityOfWashington_IcuoverUpper") %>% filter(name == "Alabama"), x = ~dates,
y = ~data, type = "scatter", mode = "lines", line = list(color = "transparent"),
legendgroup = "Alabama", name = "Alabama - Upper Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "Alabama") %>% filter(value_id ==
"UniversityOfWashington_IcuoverLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(255,205,160,0.2)", line = list(color = "transparent"),
legendgroup = "Alabama", name = "Alabama - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "Alabama") %>% filter(value_id ==
"UniversityOfWashington_IcuoverMean"), type = "scatter", mode = "lines",
line = list(color = "rgb(255,205,160)"), legendgroup = "Alabama", name = "Alabama - Mean Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_icuover, value_id ==
"UniversityOfWashington_IcuoverUpper") %>% filter(name == "Alaska"), x = ~dates,
y = ~data, type = "scatter", mode = "lines", line = list(color = "transparent"),
legendgroup = "Alaska", name = "Alaska - Upper Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "Alaska") %>% filter(value_id ==
"UniversityOfWashington_IcuoverLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(170,225,175,0.2)", line = list(color = "transparent"),
legendgroup = "Alaska", name = "Alaska - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "Alaska") %>% filter(value_id ==
"UniversityOfWashington_IcuoverMean"), type = "scatter", mode = "lines",
line = list(color = "rgb(170,225,175)"), legendgroup = "Alaska", name = "Alaska - Mean Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_icuover, value_id ==
"UniversityOfWashington_IcuoverUpper") %>% filter(name == "Arizona"), x = ~dates,
y = ~data, type = "scatter", mode = "lines", line = list(color = "transparent"),
legendgroup = "Arizona", name = "Arizona - Upper Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "Arizona") %>% filter(value_id ==
"UniversityOfWashington_IcuoverLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(250,170,175,0.2)", line = list(color = "transparent"),
legendgroup = "Arizona", name = "Arizona - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "Arizona") %>% filter(value_id ==
"UniversityOfWashington_IcuoverMean"), type = "scatter", mode = "lines",
line = list(color = "rgb(250,170,175)"), legendgroup = "Arizona", name = "Arizona - Mean Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_icuover, value_id ==
"UniversityOfWashington_IcuoverUpper") %>% filter(name == "Arkansas"), x = ~dates,
y = ~data, type = "scatter", mode = "lines", line = list(color = "transparent"),
legendgroup = "Arkansas", name = "Arkansas - Upper Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "Arkansas") %>% filter(value_id ==
"UniversityOfWashington_IcuoverLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(220,195,235,0.2)", line = list(color = "transparent"),
legendgroup = "Arkansas", name = "Arkansas - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "Arkansas") %>% filter(value_id ==
"UniversityOfWashington_IcuoverMean"), type = "scatter", mode = "lines",
line = list(color = "rgb(220,195,235)"), legendgroup = "Arkansas", name = "Arkansas - Mean Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_icuover, value_id ==
"UniversityOfWashington_IcuoverUpper") %>% filter(name == "California"), x = ~dates,
y = ~data, type = "scatter", mode = "lines", line = list(color = "transparent"),
legendgroup = "California", name = "California - Upper Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "California") %>% filter(value_id ==
"UniversityOfWashington_IcuoverLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(215,190,190,0.2)", line = list(color = "transparent"),
legendgroup = "California", name = "California - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "California") %>% filter(value_id ==
"UniversityOfWashington_IcuoverMean"), type = "scatter", mode = "lines",
line = list(color = "rgb(215,190,190)"), legendgroup = "California", name = "California - Mean Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_icuover, value_id ==
"UniversityOfWashington_IcuoverUpper") %>% filter(name == "Colorado"), x = ~dates,
y = ~data, type = "scatter", mode = "lines", line = list(color = "transparent"),
legendgroup = "Colorado", name = "Colorado - Upper Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "Colorado") %>% filter(value_id ==
"UniversityOfWashington_IcuoverLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(250,200,235,0.2)", line = list(color = "transparent"),
legendgroup = "Colorado", name = "Colorado - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "Colorado") %>% filter(value_id ==
"UniversityOfWashington_IcuoverMean"), type = "scatter", mode = "lines",
line = list(color = "rgb(250,200,235)"), legendgroup = "Colorado", name = "Colorado - Mean Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_icuover, value_id ==
"UniversityOfWashington_IcuoverUpper") %>% filter(name == "Connecticut"), x = ~dates,
y = ~data, type = "scatter", mode = "lines", line = list(color = "transparent"),
legendgroup = "Connecticut", name = "Connecticut - Upper Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "Connecticut") %>% filter(value_id ==
"UniversityOfWashington_IcuoverLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(210,210,210,0.2)", line = list(color = "transparent"),
legendgroup = "Connecticut", name = "Connecticut - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "Connecticut") %>% filter(value_id ==
"UniversityOfWashington_IcuoverMean"), type = "scatter", mode = "lines",
line = list(color = "rgb(210,210,210)"), legendgroup = "Connecticut", name = "Connecticut - Mean Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_icuover, value_id ==
"UniversityOfWashington_IcuoverUpper") %>% filter(name == "Delaware"), x = ~dates,
y = ~data, type = "scatter", mode = "lines", line = list(color = "transparent"),
legendgroup = "Delaware", name = "Delaware - Upper Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "Delaware") %>% filter(value_id ==
"UniversityOfWashington_IcuoverLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(230,230,170,0.2)", line = list(color = "transparent"),
legendgroup = "Delaware", name = "Delaware - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "Delaware") %>% filter(value_id ==
"UniversityOfWashington_IcuoverMean"), type = "scatter", mode = "lines",
line = list(color = "rgb(230,230,170)"), legendgroup = "Delaware", name = "Delaware - Mean Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_icuover, value_id ==
"UniversityOfWashington_IcuoverUpper") %>% filter(name == "DistrictofColumbia"),
x = ~dates, y = ~data, type = "scatter", mode = "lines", line = list(color = "transparent"),
legendgroup = "DistrictofColumbia", name = "District of Columbia - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_icuover, name == "DistrictofColumbia") %>%
filter(value_id == "UniversityOfWashington_IcuoverLower"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(160,235,240,0.2)", line = list(color = "transparent"),
legendgroup = "DistrictofColumbia", name = "District of Columbia - Lower Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_icuover, name == "DistrictofColumbia") %>%
filter(value_id == "UniversityOfWashington_IcuoverMean"), type = "scatter", mode = "lines",
line = list(color = "rgb(160,235,240)"), legendgroup = "DistrictofColumbia",
name = "District of Columbia - Mean Estimate", visible = "legendonly") %>% add_trace(data = filter(uw_icuover,
value_id == "UniversityOfWashington_IcuoverUpper") %>% filter(name == "Florida"),
x = ~dates, y = ~data, type = "scatter", mode = "lines", line = list(color = "transparent"),
legendgroup = "Florida", name = "Florida - Upper Estimate") %>% add_trace(data = filter(uw_icuover,
name == "Florida") %>% filter(value_id == "UniversityOfWashington_IcuoverLower"),
type = "scatter", mode = "lines", fill = "tonexty", fillcolor = "rgba(170,205,230,0.2)",
line = list(color = "transparent"), legendgroup = "Florida", name = "Florida - Lower Estimate") %>%
add_trace(data = filter(uw_icuover, name == "Florida") %>% filter(value_id ==
"UniversityOfWashington_IcuoverMean"), type = "scatter", mode = "lines",
line = list(color = "rgb(170,205,230)"), legendgroup = "Florida", name = "Florida - Mean Estimate") %>%
add_trace(data = filter(uw_icuover, value_id == "UniversityOfWashington_IcuoverUpper") %>%
filter(name == "Georgia"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Georgia", name = "Georgia - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_icuover, name == "Georgia") %>%
filter(value_id == "UniversityOfWashington_IcuoverLower"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(255,205,160,0.2)", line = list(color = "transparent"),
legendgroup = "Georgia", name = "Georgia - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "Georgia") %>% filter(value_id ==
"UniversityOfWashington_IcuoverMean"), type = "scatter", mode = "lines",
line = list(color = "rgb(255,205,160)"), legendgroup = "Georgia", name = "Georgia - Mean Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_icuover, value_id ==
"UniversityOfWashington_IcuoverUpper") %>% filter(name == "Idaho"), x = ~dates,
y = ~data, type = "scatter", mode = "lines", line = list(color = "transparent"),
legendgroup = "Idaho", name = "Idaho - Upper Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "Idaho") %>% filter(value_id == "UniversityOfWashington_IcuoverLower"),
type = "scatter", mode = "lines", fill = "tonexty", fillcolor = "rgba(170,225,175,0.2)",
line = list(color = "transparent"), legendgroup = "Idaho", name = "Idaho - Lower Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_icuover, name == "Idaho") %>%
filter(value_id == "UniversityOfWashington_IcuoverMean"), type = "scatter", mode = "lines",
line = list(color = "rgb(170,225,175)"), legendgroup = "Idaho", name = "Idaho - Mean Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_icuover, value_id == "UniversityOfWashington_IcuoverUpper") %>%
filter(name == "Illinois"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Illinois", name = "Illinois - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_icuover, name == "Illinois") %>%
filter(value_id == "UniversityOfWashington_IcuoverLower"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(250,175,180,0.2)", line = list(color = "transparent"),
legendgroup = "Illinois", name = "Illinois - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "Illinois") %>% filter(value_id ==
"UniversityOfWashington_IcuoverMean"), type = "scatter", mode = "lines",
line = list(color = "rgb(250,175,180)"), legendgroup = "Illinois", name = "Illinois - Mean Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_icuover, value_id ==
"UniversityOfWashington_IcuoverUpper") %>% filter(name == "Indiana"), x = ~dates,
y = ~data, type = "scatter", mode = "lines", line = list(color = "transparent"),
legendgroup = "Indiana", name = "Indiana - Upper Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "Indiana") %>% filter(value_id ==
"UniversityOfWashington_IcuoverLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(220,195,235,0.2)", line = list(color = "transparent"),
legendgroup = "Indiana", name = "Indiana - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "Indiana") %>% filter(value_id ==
"UniversityOfWashington_IcuoverMean"), type = "scatter", mode = "lines",
line = list(color = "rgb(220,195,235)"), legendgroup = "Indiana", name = "Indiana - Mean Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_icuover, value_id ==
"UniversityOfWashington_IcuoverUpper") %>% filter(name == "Iowa"), x = ~dates,
y = ~data, type = "scatter", mode = "lines", line = list(color = "transparent"),
legendgroup = "Iowa", name = "Iowa - Upper Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "Iowa") %>% filter(value_id == "UniversityOfWashington_IcuoverLower"),
type = "scatter", mode = "lines", fill = "tonexty", fillcolor = "rgba(215,190,190,0.2)",
line = list(color = "transparent"), legendgroup = "Iowa", name = "Iowa - Lower Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_icuover, name == "Iowa") %>%
filter(value_id == "UniversityOfWashington_IcuoverMean"), type = "scatter", mode = "lines",
line = list(color = "rgb(215,190,190)"), legendgroup = "Iowa", name = "Iowa - Mean Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_icuover, value_id == "UniversityOfWashington_IcuoverUpper") %>%
filter(name == "Kansas"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Kansas", name = "Kansas - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_icuover, name == "Kansas") %>%
filter(value_id == "UniversityOfWashington_IcuoverLower"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(250,200,235,0.2)", line = list(color = "transparent"),
legendgroup = "Kansas", name = "Kansas - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "Kansas") %>% filter(value_id ==
"UniversityOfWashington_IcuoverMean"), type = "scatter", mode = "lines",
line = list(color = "rgb(250,200,235)"), legendgroup = "Kansas", name = "Kansas - Mean Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_icuover, value_id ==
"UniversityOfWashington_IcuoverUpper") %>% filter(name == "Kentucky"), x = ~dates,
y = ~data, type = "scatter", mode = "lines", line = list(color = "transparent"),
legendgroup = "Kentucky", name = "Kentucky - Upper Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "Kentucky") %>% filter(value_id ==
"UniversityOfWashington_IcuoverLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(210,210,210,0.2)", line = list(color = "transparent"),
legendgroup = "Kentucky", name = "Kentucky - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "Kentucky") %>% filter(value_id ==
"UniversityOfWashington_IcuoverMean"), type = "scatter", mode = "lines",
line = list(color = "rgb(210,210,210)"), legendgroup = "Kentucky", name = "Kentucky - Mean Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_icuover, value_id ==
"UniversityOfWashington_IcuoverUpper") %>% filter(name == "Louisiana"), x = ~dates,
y = ~data, type = "scatter", mode = "lines", line = list(color = "transparent"),
legendgroup = "Louisiana", name = "Louisiana - Upper Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "Louisiana") %>% filter(value_id ==
"UniversityOfWashington_IcuoverLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(230,235,170,0.2)", line = list(color = "transparent"),
legendgroup = "Louisiana", name = "Louisiana - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "Louisiana") %>% filter(value_id ==
"UniversityOfWashington_IcuoverMean"), type = "scatter", mode = "lines",
line = list(color = "rgb(230,235,170)"), legendgroup = "Louisiana", name = "Louisiana - Mean Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_icuover, value_id ==
"UniversityOfWashington_IcuoverUpper") %>% filter(name == "Maine"), x = ~dates,
y = ~data, type = "scatter", mode = "lines", line = list(color = "transparent"),
legendgroup = "Maine", name = "Maine - Upper Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "Maine") %>% filter(value_id == "UniversityOfWashington_IcuoverLower"),
type = "scatter", mode = "lines", fill = "tonexty", fillcolor = "rgba(160,235,240,0.2)",
line = list(color = "transparent"), legendgroup = "Maine", name = "Maine - Lower Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_icuover, name == "Maine") %>%
filter(value_id == "UniversityOfWashington_IcuoverMean"), type = "scatter", mode = "lines",
line = list(color = "rgb(160,235,240)"), legendgroup = "Maine", name = "Maine - Mean Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_icuover, value_id == "UniversityOfWashington_IcuoverUpper") %>%
filter(name == "Maryland"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Maryland", name = "Maryland - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_icuover, name == "Maryland") %>%
filter(value_id == "UniversityOfWashington_IcuoverLower"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(170,205,230,0.2)", line = list(color = "transparent"),
legendgroup = "Maryland", name = "Maryland - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "Maryland") %>% filter(value_id ==
"UniversityOfWashington_IcuoverMean"), type = "scatter", mode = "lines",
line = list(color = "rgb(170,205,230)"), legendgroup = "Maryland", name = "Maryland - Mean Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_icuover, value_id ==
"UniversityOfWashington_IcuoverUpper") %>% filter(name == "Massachusetts"), x = ~dates,
y = ~data, type = "scatter", mode = "lines", line = list(color = "transparent"),
legendgroup = "Massachusetts", name = "Massachusetts - Upper Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "Massachusetts") %>% filter(value_id ==
"UniversityOfWashington_IcuoverLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(255,205,160,0.2)", line = list(color = "transparent"),
legendgroup = "Massachusetts", name = "Massachusetts - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "Massachusetts") %>% filter(value_id ==
"UniversityOfWashington_IcuoverMean"), type = "scatter", mode = "lines",
line = list(color = "rgb(255,205,160)"), legendgroup = "Massachusetts", name = "Massachusetts - Mean Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_icuover, value_id ==
"UniversityOfWashington_IcuoverUpper") %>% filter(name == "Michigan"), x = ~dates,
y = ~data, type = "scatter", mode = "lines", line = list(color = "transparent"),
legendgroup = "Michigan", name = "Michigan - Upper Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "Michigan") %>% filter(value_id ==
"UniversityOfWashington_IcuoverLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(170,225,175,0.2)", line = list(color = "transparent"),
legendgroup = "Michigan", name = "Michigan - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "Michigan") %>% filter(value_id ==
"UniversityOfWashington_IcuoverMean"), type = "scatter", mode = "lines",
line = list(color = "rgb(170,225,175)"), legendgroup = "Michigan", name = "Michigan - Mean Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_icuover, value_id ==
"UniversityOfWashington_IcuoverUpper") %>% filter(name == "Minnesota"), x = ~dates,
y = ~data, type = "scatter", mode = "lines", line = list(color = "transparent"),
legendgroup = "Minnesota", name = "Minnesota - Upper Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "Minnesota") %>% filter(value_id ==
"UniversityOfWashington_IcuoverLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(250,170,175,0.2)", line = list(color = "transparent"),
legendgroup = "Minnesota", name = "Minnesota - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "Minnesota") %>% filter(value_id ==
"UniversityOfWashington_IcuoverMean"), type = "scatter", mode = "lines",
line = list(color = "rgb(250,170,175)"), legendgroup = "Minnesota", name = "Minnesota - Mean Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_icuover, value_id ==
"UniversityOfWashington_IcuoverUpper") %>% filter(name == "Mississippi"), x = ~dates,
y = ~data, type = "scatter", mode = "lines", line = list(color = "transparent"),
legendgroup = "Mississippi", name = "Mississippi - Upper Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "Mississippi") %>% filter(value_id ==
"UniversityOfWashington_IcuoverLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(220,195,235,0.2)", line = list(color = "transparent"),
legendgroup = "Mississippi", name = "Mississippi - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "Mississippi") %>% filter(value_id ==
"UniversityOfWashington_IcuoverMean"), type = "scatter", mode = "lines",
line = list(color = "rgb(220,195,235)"), legendgroup = "Mississippi", name = "Mississippi - Mean Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_icuover, value_id ==
"UniversityOfWashington_IcuoverUpper") %>% filter(name == "Missouri"), x = ~dates,
y = ~data, type = "scatter", mode = "lines", line = list(color = "transparent"),
legendgroup = "Missouri", name = "Missouri - Upper Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "Missouri") %>% filter(value_id ==
"UniversityOfWashington_IcuoverLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(215,190,190,0.2)", line = list(color = "transparent"),
legendgroup = "Missouri", name = "Missouri - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "Missouri") %>% filter(value_id ==
"UniversityOfWashington_IcuoverMean"), type = "scatter", mode = "lines",
line = list(color = "rgb(215,190,190)"), legendgroup = "Missouri", name = "Missouri - Mean Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_icuover, value_id ==
"UniversityOfWashington_IcuoverUpper") %>% filter(name == "Montana"), x = ~dates,
y = ~data, type = "scatter", mode = "lines", line = list(color = "transparent"),
legendgroup = "Montana", name = "Montana - Upper Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "Montana") %>% filter(value_id ==
"UniversityOfWashington_IcuoverLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(250,200,235,0.2)", line = list(color = "transparent"),
legendgroup = "Montana", name = "Montana - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "Montana") %>% filter(value_id ==
"UniversityOfWashington_IcuoverMean"), type = "scatter", mode = "lines",
line = list(color = "rgb(250,200,235)"), legendgroup = "Montana", name = "Montana - Mean Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_icuover, value_id ==
"UniversityOfWashington_IcuoverUpper") %>% filter(name == "Nebraska"), x = ~dates,
y = ~data, type = "scatter", mode = "lines", line = list(color = "transparent"),
legendgroup = "Nebraska", name = "Nebraska - Upper Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "Nebraska") %>% filter(value_id ==
"UniversityOfWashington_IcuoverLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(210,210,210,0.2)", line = list(color = "transparent"),
legendgroup = "Nebraska", name = "Nebraska - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "Nebraska") %>% filter(value_id ==
"UniversityOfWashington_IcuoverMean"), type = "scatter", mode = "lines",
line = list(color = "rgb(210,210,210)"), legendgroup = "Nebraska", name = "Nebraska - Mean Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_icuover, value_id ==
"UniversityOfWashington_IcuoverUpper") %>% filter(name == "Nevada"), x = ~dates,
y = ~data, type = "scatter", mode = "lines", line = list(color = "transparent"),
legendgroup = "Nevada", name = "Nevada - Upper Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "Nevada") %>% filter(value_id ==
"UniversityOfWashington_IcuoverLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(230,235,170,0.2)", line = list(color = "transparent"),
legendgroup = "Nevada", name = "Nevada - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "Nevada") %>% filter(value_id ==
"UniversityOfWashington_IcuoverMean"), type = "scatter", mode = "lines",
line = list(color = "rgb(230,235,170)"), legendgroup = "Nevada", name = "Nevada - Mean Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_icuover, value_id ==
"UniversityOfWashington_IcuoverUpper") %>% filter(name == "NewHampshire"), x = ~dates,
y = ~data, type = "scatter", mode = "lines", line = list(color = "transparent"),
legendgroup = "NewHampshire", name = "New Hampshire - Upper Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "NewHampshire") %>% filter(value_id ==
"UniversityOfWashington_IcuoverLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(160,235,240,0.2)", line = list(color = "transparent"),
legendgroup = "NewHampshire", name = "New Hampshire - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "NewHampshire") %>% filter(value_id ==
"UniversityOfWashington_IcuoverMean"), type = "scatter", mode = "lines",
line = list(color = "rgb(160,235,240)"), legendgroup = "NewHampshire", name = "New Hampshire - Mean Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_icuover, value_id ==
"UniversityOfWashington_IcuoverUpper") %>% filter(name == "NewJersey"), x = ~dates,
y = ~data, type = "scatter", mode = "lines", line = list(color = "transparent"),
legendgroup = "NewJersey", name = "New Jersey - Upper Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "NewJersey") %>% filter(value_id ==
"UniversityOfWashington_IcuoverLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(170,205,230,0.2)", line = list(color = "transparent"),
legendgroup = "NewJersey", name = "New Jersey - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "NewJersey") %>% filter(value_id ==
"UniversityOfWashington_IcuoverMean"), type = "scatter", mode = "lines",
line = list(color = "rgb(170,205,230)"), legendgroup = "NewJersey", name = "New Jersey - Mean Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_icuover, value_id ==
"UniversityOfWashington_IcuoverUpper") %>% filter(name == "NewMexico"), x = ~dates,
y = ~data, type = "scatter", mode = "lines", line = list(color = "transparent"),
legendgroup = "NewMexico", name = "New Mexico - Upper Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "NewMexico") %>% filter(value_id ==
"UniversityOfWashington_IcuoverLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(255,205,160,0.2)", line = list(color = "transparent"),
legendgroup = "NewMexico", name = "New Mexico - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "NewMexico") %>% filter(value_id ==
"UniversityOfWashington_IcuoverMean"), type = "scatter", mode = "lines",
line = list(color = "rgb(255,205,160)"), legendgroup = "NewMexico", name = "New Mexico - Mean Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_icuover, value_id ==
"UniversityOfWashington_IcuoverUpper") %>% filter(name == "NewYork"), x = ~dates,
y = ~data, type = "scatter", mode = "lines", line = list(color = "transparent"),
legendgroup = "NewYork", name = "New York - Upper Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "NewYork") %>% filter(value_id ==
"UniversityOfWashington_IcuoverLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(170,225,175,0.2)", line = list(color = "transparent"),
legendgroup = "NewYork", name = "New York - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "NewYork") %>% filter(value_id ==
"UniversityOfWashington_IcuoverMean"), type = "scatter", mode = "lines",
line = list(color = "rgb(170,225,175)"), legendgroup = "NewYork", name = "New York - Mean Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_icuover, value_id ==
"UniversityOfWashington_IcuoverUpper") %>% filter(name == "NorthCarolina"), x = ~dates,
y = ~data, type = "scatter", mode = "lines", line = list(color = "transparent"),
legendgroup = "NorthCarolina", name = "North Carolina - Upper Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "NorthCarolina") %>% filter(value_id ==
"UniversityOfWashington_IcuoverLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(250,170,175,0.2)", line = list(color = "transparent"),
legendgroup = "NorthCarolina", name = "North Carolina - Lower Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_icuover, name == "NorthCarolina") %>%
filter(value_id == "UniversityOfWashington_IcuoverMean"), type = "scatter", mode = "lines",
line = list(color = "rgb(250,170,175)"), legendgroup = "NorthCarolina", name = "North Carolina - Mean Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_icuover, value_id == "UniversityOfWashington_IcuoverUpper") %>%
filter(name == "NorthDakota"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "NorthDakota", name = "North Dakota - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_icuover, name == "NorthDakota") %>%
filter(value_id == "UniversityOfWashington_IcuoverLower"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(220,195,235,0.2)", line = list(color = "transparent"),
legendgroup = "NorthDakota", name = "North Dakota - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "NorthDakota") %>% filter(value_id ==
"UniversityOfWashington_IcuoverMean"), type = "scatter", mode = "lines",
line = list(color = "rgb(220,195,235)"), legendgroup = "NorthDakota", name = "North Dakota - Mean Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_icuover, value_id ==
"UniversityOfWashington_IcuoverUpper") %>% filter(name == "Ohio"), x = ~dates,
y = ~data, type = "scatter", mode = "lines", line = list(color = "transparent"),
legendgroup = "Ohio", name = "Ohio - Upper Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "Ohio") %>% filter(value_id == "UniversityOfWashington_IcuoverLower"),
type = "scatter", mode = "lines", fill = "tonexty", fillcolor = "rgba(215,190,190,0.2)",
line = list(color = "transparent"), legendgroup = "Ohio", name = "Ohio - Lower Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_icuover, name == "Ohio") %>%
filter(value_id == "UniversityOfWashington_IcuoverMean"), type = "scatter", mode = "lines",
line = list(color = "rgb(215,190,190)"), legendgroup = "Ohio", name = "Ohio - Mean Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_icuover, value_id == "UniversityOfWashington_IcuoverUpper") %>%
filter(name == "Oklahoma"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Oklahoma", name = "Oklahoma - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_icuover, name == "Oklahoma") %>%
filter(value_id == "UniversityOfWashington_IcuoverLower"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(250,200,235,0.2)", line = list(color = "transparent"),
legendgroup = "Oklahoma", name = "Oklahoma - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "Oklahoma") %>% filter(value_id ==
"UniversityOfWashington_IcuoverMean"), type = "scatter", mode = "lines",
line = list(color = "rgb(250,200,235)"), legendgroup = "Oklahoma", name = "Oklahoma - Mean Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_icuover, value_id ==
"UniversityOfWashington_IcuoverUpper") %>% filter(name == "Oregon"), x = ~dates,
y = ~data, type = "scatter", mode = "lines", line = list(color = "transparent"),
legendgroup = "Oregon", name = "Oregon - Upper Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "Oregon") %>% filter(value_id ==
"UniversityOfWashington_IcuoverLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(210,210,210,0.2)", line = list(color = "transparent"),
legendgroup = "Oregon", name = "Oregon - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "Oregon") %>% filter(value_id ==
"UniversityOfWashington_IcuoverMean"), type = "scatter", mode = "lines",
line = list(color = "rgb(210,210,210)"), legendgroup = "Oregon", name = "Oregon - Mean Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_icuover, value_id ==
"UniversityOfWashington_IcuoverUpper") %>% filter(name == "Pennsylvania"), x = ~dates,
y = ~data, type = "scatter", mode = "lines", line = list(color = "transparent"),
legendgroup = "Pennsylvania", name = "Pennsylvania - Upper Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "Pennsylvania") %>% filter(value_id ==
"UniversityOfWashington_IcuoverLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(230,235,170,0.2)", line = list(color = "transparent"),
legendgroup = "Pennsylvania", name = "Pennsylvania - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "Pennsylvania") %>% filter(value_id ==
"UniversityOfWashington_IcuoverMean"), type = "scatter", mode = "lines",
line = list(color = "rgb(230,235,170)"), legendgroup = "Pennsylvania", name = "Pennsylvania - Mean Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_icuover, value_id ==
"UniversityOfWashington_IcuoverUpper") %>% filter(name == "PuertoRico"), x = ~dates,
y = ~data, type = "scatter", mode = "lines", line = list(color = "transparent"),
legendgroup = "PuertoRico", name = "Puerto Rico - Upper Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "PuertoRico") %>% filter(value_id ==
"UniversityOfWashington_IcuoverLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(160,235,240,0.2)", line = list(color = "transparent"),
legendgroup = "PuertoRico", name = "Puerto Rico - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "PuertoRico") %>% filter(value_id ==
"UniversityOfWashington_IcuoverMean"), type = "scatter", mode = "lines",
line = list(color = "rgb(160,235,240)"), legendgroup = "PuertoRico", name = "Puerto Rico - Mean Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_icuover, value_id ==
"UniversityOfWashington_IcuoverUpper") %>% filter(name == "RhodeIsland"), x = ~dates,
y = ~data, type = "scatter", mode = "lines", line = list(color = "transparent"),
legendgroup = "RhodeIsland", name = "Rhode Island - Upper Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "RhodeIsland") %>% filter(value_id ==
"UniversityOfWashington_IcuoverLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(170,205,230,0.2)", line = list(color = "transparent"),
legendgroup = "RhodeIsland", name = "Rhode Island - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "RhodeIsland") %>% filter(value_id ==
"UniversityOfWashington_IcuoverMean"), type = "scatter", mode = "lines",
line = list(color = "rgb(170,205,230)"), legendgroup = "RhodeIsland", name = "Rhode Island - Mean Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_icuover, value_id ==
"UniversityOfWashington_IcuoverUpper") %>% filter(name == "SouthCarolina"), x = ~dates,
y = ~data, type = "scatter", mode = "lines", line = list(color = "transparent"),
legendgroup = "SouthCarolina", name = "South Carolina - Upper Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "SouthCarolina") %>% filter(value_id ==
"UniversityOfWashington_IcuoverLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(255,205,160,0.2)", line = list(color = "transparent"),
legendgroup = "SouthCarolina", name = "South Carolina - Lower Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_icuover, name == "SouthCarolina") %>%
filter(value_id == "UniversityOfWashington_IcuoverMean"), type = "scatter", mode = "lines",
line = list(color = "rgb(255,205,160)"), legendgroup = "SouthCarolina", name = "South Carolina - Mean Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_icuover, value_id == "UniversityOfWashington_IcuoverUpper") %>%
filter(name == "SouthDakota"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "SouthDakota", name = "South Dakota - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_icuover, name == "SouthDakota") %>%
filter(value_id == "UniversityOfWashington_IcuoverLower"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(170,225,175,0.2)", line = list(color = "transparent"),
legendgroup = "SouthDakota", name = "South Dakota - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "SouthDakota") %>% filter(value_id ==
"UniversityOfWashington_IcuoverMean"), type = "scatter", mode = "lines",
line = list(color = "rgb(170,225,175)"), legendgroup = "SouthDakota", name = "South Dakota - Mean Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_icuover, value_id ==
"UniversityOfWashington_IcuoverUpper") %>% filter(name == "Tennessee"), x = ~dates,
y = ~data, type = "scatter", mode = "lines", line = list(color = "transparent"),
legendgroup = "Tennessee", name = "Tennessee - Upper Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "Tennessee") %>% filter(value_id ==
"UniversityOfWashington_IcuoverLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(250,170,175,0.2)", line = list(color = "transparent"),
legendgroup = "Tennessee", name = "Tennessee - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "Tennessee") %>% filter(value_id ==
"UniversityOfWashington_IcuoverMean"), type = "scatter", mode = "lines",
line = list(color = "rgb(250,170,175)"), legendgroup = "Tennessee", name = "Tennessee - Mean Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_icuover, value_id ==
"UniversityOfWashington_IcuoverUpper") %>% filter(name == "Texas"), x = ~dates,
y = ~data, type = "scatter", mode = "lines", line = list(color = "transparent"),
legendgroup = "Texas", name = "Texas - Upper Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "Texas") %>% filter(value_id == "UniversityOfWashington_IcuoverLower"),
type = "scatter", mode = "lines", fill = "tonexty", fillcolor = "rgba(220,195,235,0.2)",
line = list(color = "transparent"), legendgroup = "Texas", name = "Texas - Lower Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_icuover, name == "Texas") %>%
filter(value_id == "UniversityOfWashington_IcuoverMean"), type = "scatter", mode = "lines",
line = list(color = "rgb(220,195,235)"), legendgroup = "Texas", name = "Texas - Mean Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_icuover, value_id == "UniversityOfWashington_IcuoverUpper") %>%
filter(name == "Utah"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Utah", name = "Utah - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_icuover, name == "Utah") %>%
filter(value_id == "UniversityOfWashington_IcuoverLower"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(215,190,190,0.2)", line = list(color = "transparent"),
legendgroup = "Utah", name = "Utah - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "Utah") %>% filter(value_id == "UniversityOfWashington_IcuoverMean"),
type = "scatter", mode = "lines", line = list(color = "rgb(215,190,190)"),
legendgroup = "Utah", name = "Utah - Mean Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, value_id == "UniversityOfWashington_IcuoverUpper") %>%
filter(name == "Vermont"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "transparent"), legendgroup = "Vermont", name = "Vermont - Upper Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_icuover, name == "Vermont") %>%
filter(value_id == "UniversityOfWashington_IcuoverLower"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(250,200,235,0.2)", line = list(color = "transparent"),
legendgroup = "Vermont", name = "Vermont - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "Vermont") %>% filter(value_id ==
"UniversityOfWashington_IcuoverMean"), type = "scatter", mode = "lines",
line = list(color = "rgb(250,200,235)"), legendgroup = "Vermont", name = "Vermont - Mean Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_icuover, value_id ==
"UniversityOfWashington_IcuoverUpper") %>% filter(name == "Virginia"), x = ~dates,
y = ~data, type = "scatter", mode = "lines", line = list(color = "transparent"),
legendgroup = "Virginia", name = "Virginia - Upper Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "Virginia") %>% filter(value_id ==
"UniversityOfWashington_IcuoverLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(210,210,210,0.2)", line = list(color = "transparent"),
legendgroup = "Virginia", name = "Virginia - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "Virginia") %>% filter(value_id ==
"UniversityOfWashington_IcuoverMean"), type = "scatter", mode = "lines",
line = list(color = "rgb(210,210,210)"), legendgroup = "Virginia", name = "Virginia - Mean Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_icuover, value_id ==
"UniversityOfWashington_IcuoverUpper") %>% filter(name == "Washington"), x = ~dates,
y = ~data, type = "scatter", mode = "lines", line = list(color = "transparent"),
legendgroup = "Washington", name = "Washington - Upper Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "Washington") %>% filter(value_id ==
"UniversityOfWashington_IcuoverLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(230,235,170,0.2)", line = list(color = "transparent"),
legendgroup = "Washington", name = "Washington - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "Washington") %>% filter(value_id ==
"UniversityOfWashington_IcuoverMean"), type = "scatter", mode = "lines",
line = list(color = "rgb(230,235,170)"), legendgroup = "Washington", name = "Washington - Mean Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_icuover, value_id ==
"UniversityOfWashington_IcuoverUpper") %>% filter(name == "WestVirginia"), x = ~dates,
y = ~data, type = "scatter", mode = "lines", line = list(color = "transparent"),
legendgroup = "WestVirginia", name = "West Virginia - Upper Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "WestVirginia") %>% filter(value_id ==
"UniversityOfWashington_IcuoverLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(160,235,240,0.2)", line = list(color = "transparent"),
legendgroup = "WestVirginia", name = "West Virginia - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "WestVirginia") %>% filter(value_id ==
"UniversityOfWashington_IcuoverMean"), type = "scatter", mode = "lines",
line = list(color = "rgb(160,235,240)"), legendgroup = "WestVirginia", name = "West Virginia - Mean Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_icuover, value_id ==
"UniversityOfWashington_IcuoverUpper") %>% filter(name == "Wisconsin"), x = ~dates,
y = ~data, type = "scatter", mode = "lines", line = list(color = "transparent"),
legendgroup = "Wisconsin", name = "Wisconsin - Upper Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "Wisconsin") %>% filter(value_id ==
"UniversityOfWashington_IcuoverLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(170,205,230,0.2)", line = list(color = "transparent"),
legendgroup = "Wisconsin", name = "Wisconsin - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "Wisconsin") %>% filter(value_id ==
"UniversityOfWashington_IcuoverMean"), type = "scatter", mode = "lines",
line = list(color = "rgb(170,205,230)"), legendgroup = "Wisconsin", name = "Wisconsin - Mean Estimate",
visible = "legendonly") %>% add_trace(data = filter(uw_icuover, value_id ==
"UniversityOfWashington_IcuoverUpper") %>% filter(name == "Wyoming"), x = ~dates,
y = ~data, type = "scatter", mode = "lines", line = list(color = "transparent"),
legendgroup = "Wyoming", name = "Wyoming - Upper Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "Wyoming") %>% filter(value_id ==
"UniversityOfWashington_IcuoverLower"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(255,210,165,0.2)", line = list(color = "transparent"),
legendgroup = "Wyoming", name = "Wyoming - Lower Estimate", visible = "legendonly") %>%
add_trace(data = filter(uw_icuover, name == "Wyoming") %>% filter(value_id ==
"UniversityOfWashington_IcuoverMean"), type = "scatter", mode = "lines",
line = list(color = "rgb(255,210,165)"), legendgroup = "Wyoming", name = "Wyoming - Mean Estimate",
visible = "legendonly") %>% layout(title = "Mean, Upper and Lower Estimates for Shortage of ICU Beds for COVID-19 per Day",
paper_bgcolor = "rgb(200,200,200)", plot_bgcolor = "rgb(150,150,150)", xaxis = list(title = "Date",
gridcolor = "rgb(255,255,255)", showgrid = TRUE, showline = FALSE, showticklabels = TRUE,
tickcolor = "rgb(127,127,127)", ticks = "outside", zeroline = FALSE), yaxis = list(title = "ICU Beds Missing",
gridcolor = "rgb(255,255,255)", showgrid = TRUE, showline = FALSE, showticklabels = TRUE,
tickcolor = "rgb(127,127,127)", ticks = "outside", zeroline = FALSE), margin = list(l = 80,
r = 80, b = 75, t = 100, pad = 4))
Governance and Compliance
Here, we’ll look at the policies enacted in Hawaii during the pandemic and how the population has responded in their behavior.
Timeline of Policies in Hawaii
# Data downloaded from https://github.com/OxCGRT/USA-covid-policy
githubfile <- "https://raw.githubusercontent.com/OxCGRT/USA-covid-policy/master/data/OxCGRT_US_latest.csv"
policies <- read.csv(url(githubfile))
policies <- policies %>% mutate(Date = as.Date(paste(policies$Date, sep = ""), "%Y%m%d"))
timevis <- policies %>% mutate(RegionName = as.character(RegionName %>% na_if(.,
""))) %>% mutate(RegionName = replace_na(RegionName, "USA"))
timeline_data <- timevis %>% select(Date, RegionName, C1_Flag, description = C1_School.closing,
title = C1_Notes) %>% mutate(month = month(Date), end = "na", group = "Containment") %>%
distinct_at(vars(-Date), .keep_all = TRUE) %>% filter(RegionName == "Hawaii",
Date != "2020-01-01", str_detect(title, "No policy change|No updates|Guidance unchanged",
negate = TRUE)) %>% distinct(title, .keep_all = TRUE) %>% distinct(RegionName,
C1_Flag, description, month, .keep_all = TRUE) %>% mutate(C1_Flag = C1_Flag %>%
recode(`0` = "[Targeted]", `1` = "[General]"), description = description %>%
recode(`0` = "No school measures", `1` = "Recommend school alterations or closures",
`2` = "Closing some schools", `3` = "Closing all schools")) %>% unite(content,
description:C1_Flag, sep = " ", na.rm = TRUE, remove = TRUE)
timeline_data <- timevis %>% select(Date, RegionName, C2_Flag, description = C2_Workplace.closing,
title = C2_Notes) %>% mutate(month = month(Date), end = "na", group = "Containment") %>%
distinct_at(vars(-Date), .keep_all = TRUE) %>% filter(RegionName == "Hawaii",
Date != "2020-01-01", str_detect(title, "No policy change|No updates|Guidance unchanged",
negate = TRUE)) %>% distinct(title, .keep_all = TRUE) %>% distinct(RegionName,
C2_Flag, description, month, .keep_all = TRUE) %>% mutate(C2_Flag = C2_Flag %>%
recode(`0` = "[Targeted]", `1` = "[General]"), description = description %>%
recode(`0` = "No work measures", `1` = "Recommend work from home or closing",
`2` = "Closing some workplaces", `3` = "Closing all workplaces (-essential)")) %>%
unite(content, description:C2_Flag, sep = " ", na.rm = TRUE, remove = TRUE) %>%
bind_rows(timeline_data)
timeline_data <- timevis %>% select(Date, RegionName, C3_Flag, description = C3_Cancel.public.events,
title = C3_Notes) %>% mutate(month = month(Date), end = "na", group = "Containment") %>%
distinct_at(vars(-Date), .keep_all = TRUE) %>% filter(RegionName == "Hawaii",
Date != "2020-01-01", str_detect(title, "No policy change|No updates|Guidance unchanged",
negate = TRUE)) %>% distinct(title, .keep_all = TRUE) %>% distinct(RegionName,
C3_Flag, description, month, .keep_all = TRUE) %>% mutate(C3_Flag = C3_Flag %>%
recode(`0` = "[Targeted]", `1` = "[General]"), description = description %>%
recode(`0` = "No events measures", `1` = "Recommend cancelling events", `2` = "Require cancelling events")) %>%
unite(content, description:C3_Flag, sep = " ", na.rm = TRUE, remove = TRUE) %>%
bind_rows(timeline_data)
timeline_data <- timevis %>% select(Date, RegionName, C4_Flag, description = C4_Restrictions.on.gatherings,
title = C4_Notes) %>% mutate(month = month(Date), end = "na", group = "Containment") %>%
distinct_at(vars(-Date), .keep_all = TRUE) %>% filter(RegionName == "Hawaii",
Date != "2020-01-01", str_detect(title, "No policy change|No updates|Guidance unchanged",
negate = TRUE)) %>% distinct(title, .keep_all = TRUE) %>% distinct(RegionName,
C4_Flag, description, month, .keep_all = TRUE) %>% mutate(C4_Flag = C4_Flag %>%
recode(`0` = "[Targeted]", `1` = "[General]"), description = description %>%
recode(`0` = "No gathering restrictions", `1` = "Restrict >1000 people Gatherings",
`2` = "Restrict 101-1000 people gatherings", `3` = "Restrict 101-1000 people gatherings",
`4` = "Restrict ≤10 people gatherings")) %>% unite(content, description:C4_Flag,
sep = " ", na.rm = TRUE, remove = TRUE) %>% bind_rows(timeline_data)
timeline_data <- timevis %>% select(Date, RegionName, C5_Flag, description = C5_Close.public.transport,
title = C5_Notes) %>% mutate(month = month(Date), end = "na", group = "Containment") %>%
distinct_at(vars(-Date), .keep_all = TRUE) %>% filter(RegionName == "Hawaii",
Date != "2020-01-01", str_detect(title, "No policy change|No updates|Guidance unchanged",
negate = TRUE)) %>% distinct(title, .keep_all = TRUE) %>% distinct(RegionName,
C5_Flag, description, month, .keep_all = TRUE) %>% mutate(C5_Flag = C5_Flag %>%
recode(`0` = "[Targeted]", `1` = "[General]"), description = description %>%
recode(`0` = "No transit measures", `1` = "Recommend reducing or closing transit",
`2` = "Closing all transit")) %>% unite(content, description:C5_Flag, sep = " ",
na.rm = TRUE, remove = TRUE) %>% bind_rows(timeline_data)
timeline_data <- timevis %>% select(Date, RegionName, C6_Flag, description = C6_Stay.at.home.requirements,
title = C6_Notes) %>% mutate(month = month(Date), end = "na", group = "Containment") %>%
distinct_at(vars(-Date), .keep_all = TRUE) %>% filter(RegionName == "Hawaii",
Date != "2020-01-01", str_detect(title, "No policy change|No updates|Guidance unchanged",
negate = TRUE)) %>% distinct(title, .keep_all = TRUE) %>% distinct(RegionName,
C6_Flag, description, month, .keep_all = TRUE) %>% mutate(C6_Flag = C6_Flag %>%
recode(`0` = "[Targeted]", `1` = "[General]"), description = description %>%
recode(`0` = "No stay home measures", `1` = "Recommend stay home", `2` = "Stay home (with exceptions)",
`3` = "Stay home (min. exceptions)")) %>% unite(content, description:C6_Flag,
sep = " ", na.rm = TRUE, remove = TRUE) %>% bind_rows(timeline_data)
timeline_data <- timevis %>% select(Date, RegionName, C7_Flag, description = C7_Restrictions.on.internal.movement,
title = C7_Notes) %>% mutate(month = month(Date), end = "na", group = "Containment") %>%
distinct_at(vars(-Date), .keep_all = TRUE) %>% filter(RegionName == "Hawaii",
Date != "2020-01-01", str_detect(title, "No policy change|No updates|Guidance unchanged",
negate = TRUE)) %>% distinct(title, .keep_all = TRUE) %>% distinct(RegionName,
C7_Flag, description, month, .keep_all = TRUE) %>% mutate(C7_Flag = C7_Flag %>%
recode(`0` = "[Targeted]", `1` = "[General]"), description = description %>%
recode(`0` = "No dom. travel measures", `1` = "Recommend less dom. travel", `2` = "Dom. travel restricted")) %>%
unite(content, description:C7_Flag, sep = " ", na.rm = TRUE, remove = TRUE) %>%
bind_rows(timeline_data)
timeline_data <- timevis %>% select(Date, RegionName, content = C8_International.travel.controls,
title = C8_Notes) %>% mutate(month = month(Date), end = "na", group = "Containment") %>%
distinct_at(vars(-Date), .keep_all = TRUE) %>% filter(RegionName == "Hawaii",
Date != "2020-01-01", str_detect(title, "No policy change|No updates|Guidance unchanged",
negate = TRUE)) %>% distinct(title, .keep_all = TRUE) %>% distinct(RegionName,
content, month, .keep_all = TRUE) %>% mutate(content = content %>% recode(`0` = "No intl travel measures",
`1` = "Screening intl arrivals", `2` = "Quarantine some/all arrivals", `3` = "Ban some arrivals",
`4` = "Ban all arrivals/close borders")) %>% bind_rows(timeline_data)
timeline_data <- timevis %>% select(Date, RegionName, E1_Flag, description = E1_Income.support,
title = E1_Notes) %>% mutate(month = month(Date), end = "na", group = "Economic") %>%
distinct_at(vars(-Date), .keep_all = TRUE) %>% filter(RegionName == "Hawaii",
Date != "2020-01-01", str_detect(title, "No policy change|No updates|Guidance unchanged",
negate = TRUE)) %>% distinct(title, .keep_all = TRUE) %>% distinct(RegionName,
E1_Flag, description, month, .keep_all = TRUE) %>% mutate(E1_Flag = E1_Flag %>%
recode(`0` = "[Formal Workers Only]", `1` = "[Formal+Informal]"), description = description %>%
recode(`0` = "No income support", `1` = "Gov't replacing <50% lost salary", `2` = "Gov't replacing >50% lost salary")) %>%
unite(content, description:E1_Flag, sep = " ", na.rm = TRUE, remove = TRUE) %>%
bind_rows(timeline_data)
timeline_data <- timevis %>% select(Date, RegionName, content = E2_Debt.contract.relief,
title = E2_Notes) %>% mutate(month = month(Date), end = "na", group = "Economic") %>%
distinct_at(vars(-Date), .keep_all = TRUE) %>% filter(RegionName == "Hawaii",
Date != "2020-01-01", str_detect(title, "No policy change|No updates|Guidance unchanged",
negate = TRUE)) %>% distinct(title, .keep_all = TRUE) %>% distinct(RegionName,
content, month, .keep_all = TRUE) %>% mutate(content = content %>% recode(`0` = "No debt/contract relief",
`1` = "Narrow debt/contract relief", `2` = "Broad debt/contract relief")) %>%
bind_rows(timeline_data)
timeline_data <- timevis %>% select(Date, RegionName, description = E3_Fiscal.measures,
title = E3_Notes) %>% mutate(month = month(Date), end = "na", type = "Stimulus",
group = "Economic") %>% distinct_at(vars(-Date), .keep_all = TRUE) %>% filter(RegionName ==
"Hawaii", Date != "2020-01-01", str_detect(title, "No policy change|No updates|Guidance unchanged",
negate = TRUE)) %>% distinct(title, .keep_all = TRUE) %>% unite(content, c(type,
description), sep = ": $", na.rm = TRUE, remove = TRUE) %>% bind_rows(timeline_data)
timeline_data <- timevis %>% select(Date, RegionName, description = E4_International.support,
title = E4_Notes) %>% mutate(month = month(Date), end = "na", type = "Outgoing aid",
group = "Economic") %>% distinct_at(vars(-Date), .keep_all = TRUE) %>% filter(RegionName ==
"Hawaii", Date != "2020-01-01", str_detect(title, "No policy change|No updates|Guidance unchanged",
negate = TRUE)) %>% distinct(title, .keep_all = TRUE) %>% unite(content, c(type,
description), sep = ": $", na.rm = TRUE, remove = TRUE) %>% bind_rows(timeline_data)
timeline_data <- timevis %>% select(Date, RegionName, H1_Flag, description = H1_Public.information.campaigns,
title = H1_Notes) %>% mutate(month = month(Date), end = "na", group = "Health") %>%
distinct_at(vars(-Date), .keep_all = TRUE) %>% filter(RegionName == "Hawaii",
Date != "2020-01-01", str_detect(title, "No policy change|No updates|Guidance unchanged",
negate = TRUE)) %>% distinct(title, .keep_all = TRUE) %>% distinct(RegionName,
H1_Flag, description, month, .keep_all = TRUE) %>% mutate(H1_Flag = H1_Flag %>%
recode(`0` = "[Targeted]", `1` = "[General]"), description = description %>%
recode(`0` = "No health info measures", `1` = "Urging caution", `2` = "Coordinated info campaign")) %>%
unite(content, description:H1_Flag, sep = " ", na.rm = TRUE, remove = TRUE) %>%
bind_rows(timeline_data)
timeline_data <- timevis %>% select(Date, RegionName, content = H2_Testing.policy,
title = H2_Notes) %>% mutate(month = month(Date), end = "na", group = "Health") %>%
distinct_at(vars(-Date), .keep_all = TRUE) %>% filter(RegionName == "Hawaii",
Date != "2020-01-01", str_detect(title, "No policy change|No updates|Guidance unchanged",
negate = TRUE)) %>% distinct(title, .keep_all = TRUE) %>% distinct(RegionName,
content, month, .keep_all = TRUE) %>% mutate(content = content %>% recode(`0` = "No testing policy",
`1` = "Testing only symptomatic + meets criteria", `2` = "Testing all symptomatic",
`3` = "Open public testing")) %>% bind_rows(timeline_data)
timeline_data <- timevis %>% select(Date, RegionName, content = H3_Contact.tracing,
title = H3_Notes) %>% mutate(month = month(Date), end = "na", group = "Health") %>%
distinct_at(vars(-Date), .keep_all = TRUE) %>% filter(RegionName == "Hawaii",
Date != "2020-01-01", str_detect(title, "No policy change|No updates|Guidance unchanged",
negate = TRUE)) %>% distinct(title, .keep_all = TRUE) %>% distinct(RegionName,
content, month, .keep_all = TRUE) %>% mutate(content = content %>% recode(`0` = "No contact tracing",
`1` = "Limited contact tracing", `2` = "Comprehensive contact tracing")) %>%
bind_rows(timeline_data)
timeline_data <- timevis %>% select(Date, RegionName, description = H4_Emergency.investment.in.healthcare,
title = H4_Notes) %>% mutate(month = month(Date), end = "na", type = "Healthcare investments",
group = "Health") %>% distinct_at(vars(-Date), .keep_all = TRUE) %>% filter(RegionName ==
"Hawaii", Date != "2020-01-01", str_detect(title, "No policy change|No updates|Guidance unchanged",
negate = TRUE)) %>% distinct(title, .keep_all = TRUE) %>% unite(content, c(type,
description), sep = ": $", na.rm = TRUE, remove = TRUE) %>% bind_rows(timeline_data)
timeline_data <- timevis %>% select(Date, RegionName, description = H5_Investment.in.vaccines,
title = H5_Notes) %>% mutate(month = month(Date), end = "na", type = "Vaccine investments",
group = "Health") %>% distinct_at(vars(-Date), .keep_all = TRUE) %>% filter(RegionName ==
"Hawaii", Date != "2020-01-01", str_detect(title, "No policy change|No updates|Guidance unchanged",
negate = TRUE)) %>% distinct(title, .keep_all = TRUE) %>% unite(content, c(type,
description), sep = ": $", na.rm = TRUE, remove = TRUE) %>% bind_rows(timeline_data)
timeline_data <- timevis %>% select(Date, RegionName, H6_Flag, description = H6_Facial.Coverings,
title = H6_Notes) %>% mutate(month = month(Date), end = "na", group = "Health") %>%
distinct_at(vars(-Date), .keep_all = TRUE) %>% filter(RegionName == "Hawaii",
Date != "2020-01-01", str_detect(title, "No policy change|No updates|Guidance unchanged",
negate = TRUE)) %>% distinct(title, .keep_all = TRUE) %>% distinct(RegionName,
H6_Flag, description, month, .keep_all = TRUE) %>% mutate(H6_Flag = H6_Flag %>%
recode(`0` = "[Targeted]", `1` = "[General]"), description = description %>%
recode(`0` = "No mask policy", `1` = "Masks recommended", `2` = "Masks required sometimes",
`3` = "Masks required in public", `4` = "Masks always required")) %>% unite(content,
description:H6_Flag, sep = " ", na.rm = TRUE, remove = TRUE) %>% bind_rows(timeline_data)
timeline_data <- timevis %>% select(Date, RegionName, H7_Flag, description = H7_Vaccination.policy,
title = H7_Notes) %>% mutate(month = month(Date), end = "na", group = "Health") %>%
distinct_at(vars(-Date), .keep_all = TRUE) %>% filter(RegionName == "Hawaii",
Date != "2020-01-01", str_detect(title, "No policy change|No updates|Guidance unchanged",
negate = TRUE)) %>% distinct(title, .keep_all = TRUE) %>% distinct(RegionName,
H7_Flag, description, month, .keep_all = TRUE) %>% mutate(H7_Flag = H7_Flag %>%
recode(`0` = "[Cost to individual]", `1` = "[No cost to individual]"), description = description %>%
recode(`0` = "No vaccine availability", `1` = "Vaccines for 1 key group", `2` = "Vaccines for 2 key groups",
`3` = "Vaccines for all key groups", `4` = "Vaccines for all key groups + some others",
`5` = "Universal vaccine availability")) %>% unite(content, description:H7_Flag,
sep = " ", na.rm = TRUE, remove = TRUE) %>% bind_rows(timeline_data)
timeline_data <- timeline_data %>% mutate(id = 1:nrow(timeline_data), end = na_if(end,
"na"), group = as.factor(group)) %>% select(id, content, start = Date, end, title,
group) %>% filter(start != "2020-02-01")
timeline_groups <- data.frame(id = levels(timeline_data[, "group"]), content = levels(timeline_data[,
"group"]))
timevis(data = timeline_data, groups = timeline_groups, options = list(height = "100%")) %>%
setWindow("2020-03-17", "2020-03-24")
This is a timeline of policies enacted in Hawaii, produced with data from OxCGRT. Due to how easily cluttered the timeline can get, only data that had distinct policies, geography, and month were kept. This undoubtedly excluded several developments, but this nevertheless serves as a general overview of the actions that the states and counties undertook during the pandemic.
Mobility
To look at how people responded to lockdown measures, we also draw mobility data from Google and Apple.
movement <- evalmetrics(
"outbreaklocation",
list(
spec = list(
ids = states_list,
expressions = list(
"Apple_WalkingMobility",
"Apple_DrivingMobility",
"Apple_TransitMobility",
"Google_ParksMobility",
"Google_ResidentialMobility",
"Google_RetailMobility",
"Google_GroceryMobility",
"Google_TransitStationsMobility",
"Google_WorkplacesMobility",
"PlaceIQ_DeviceExposure_Adjusted"
),
start = "2020-02-15",
end = today,
interval = "DAY"
)
),
get_all = TRUE
) %>%
filter(missing == 0) %>%
dplyr::select(-missing)
mobility <- movement %>%
filter(str_detect(value_id, "Google|Apple")) %>%
filter(!str_detect(value_id, "Apple") | !(as.character(dates) %in% c("2020-05-11", "2020-05-12"))) %>% # Apple data not available May 11-12
group_by(name, value_id) %>%
arrange(dates) %>%
mutate(mobility_smoothed = rollmean(data, 7, align = "right", fill = NA)) %>%
ungroup()
Google Mobility Data
Google provides data on movement to select geographic categories: parks, residential, grocery, public transit, and workplaces.
Overview
mobility %>% mutate(name = name %>% str_remove("_UnitedStates")) %>% filter(str_detect(value_id,
"Google")) %>% ggplot(aes(dates, mobility_smoothed/100, color = value_id)) +
geom_hline(aes(yintercept = 1), linetype = "dashed") + geom_line() + scale_y_continuous(labels = scales::percent) +
facet_wrap(vars(name)) + labs(x = "Date", y = "Mobility compared to baseline",
color = "Metric", title = "Google mobility indices by state")
Interactive View
googlemobility <- mobility %>% mutate(name = name %>% str_remove("_UnitedStates")) %>%
filter(str_detect(value_id, "Google"))
plot_ly(filter(googlemobility, value_id == "Google_ParksMobility") %>% filter(name ==
"Hawaii"), x = ~dates, y = ~data, type = "scatter", mode = "lines", line = list(color = "lime"),
legendgroup = "Hawaii", name = "Hawaii - Parks") %>% add_trace(data = filter(googlemobility,
name == "Hawaii") %>% filter(value_id == "Google_RetailMobility"), type = "scatter",
mode = "lines", line = list(color = "blue"), legendgroup = "Hawaii", name = "Hawaii - Retail") %>%
add_trace(data = filter(googlemobility, name == "Hawaii") %>% filter(value_id ==
"Google_ResidentialMobility"), type = "scatter", mode = "lines", line = list(color = "brown"),
legendgroup = "Hawaii", name = "Hawaii - Residential") %>% add_trace(data = filter(googlemobility,
name == "Hawaii") %>% filter(value_id == "Google_GroceryMobility"), type = "scatter",
mode = "lines", line = list(color = "pink"), legendgroup = "Hawaii", name = "Hawaii - Grocery") %>%
add_trace(data = filter(googlemobility, name == "Hawaii") %>% filter(value_id ==
"Google_TransitStationsMobility"), type = "scatter", mode = "lines", line = list(color = "grey"),
legendgroup = "Hawaii", name = "Hawaii - Transit Stations") %>% add_trace(data = filter(googlemobility,
name == "Hawaii") %>% filter(value_id == "Google_WorkplacesMobility"), type = "scatter",
mode = "lines", line = list(color = "orange"), legendgroup = "Hawaii", name = "Hawaii - Workplaces") %>%
add_trace(data = filter(googlemobility, name == "Alabama") %>% filter(value_id ==
"Google_ParksMobility"), opacity = 0.5, type = "scatter", mode = "lines",
line = list(color = "lime"), legendgroup = "Alabama", name = "Alabama - Parks",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name ==
"Alabama") %>% filter(value_id == "Google_RetailMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "blue"), legendgroup = "Alabama", name = "Alabama - Retail",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Alabama") %>%
filter(value_id == "Google_ResidentialMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "brown"), legendgroup = "Alabama", name = "Alabama - Residential",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Alabama") %>%
filter(value_id == "Google_GroceryMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "pink"), legendgroup = "Alabama", name = "Alabama - Grocery",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Alabama") %>%
filter(value_id == "Google_TransitStationsMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "grey"), legendgroup = "Alabama", name = "Alabama - Transit Stations",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Alabama") %>%
filter(value_id == "Google_WorkplacesMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "orange"), legendgroup = "Alabama", name = "Alabama - Workplaces",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Alaska") %>%
filter(value_id == "Google_ParksMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "lime"), legendgroup = "Alaska", name = "Alaska - Parks",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Alaska") %>%
filter(value_id == "Google_RetailMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "blue"), legendgroup = "Alaska", name = "Alaska - Retail",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Alaska") %>%
filter(value_id == "Google_ResidentialMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "brown"), legendgroup = "Alaska", name = "Alaska - Residential",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Alaska") %>%
filter(value_id == "Google_GroceryMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "pink"), legendgroup = "Alaska", name = "Alaska - Grocery",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Alaska") %>%
filter(value_id == "Google_TransitStationsMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "grey"), legendgroup = "Alaska", name = "Alaska - Transit Stations",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Alaska") %>%
filter(value_id == "Google_WorkplacesMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "orange"), legendgroup = "Alaska", name = "Alaska - Workplaces",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Arizona") %>%
filter(value_id == "Google_ParksMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "lime"), legendgroup = "Arizona", name = "Arizona - Parks",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Arizona") %>%
filter(value_id == "Google_RetailMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "blue"), legendgroup = "Arizona", name = "Arizona - Retail",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Arizona") %>%
filter(value_id == "Google_ResidentialMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "brown"), legendgroup = "Arizona", name = "Arizona - Residential",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Arizona") %>%
filter(value_id == "Google_GroceryMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "pink"), legendgroup = "Arizona", name = "Arizona - Grocery",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Arizona") %>%
filter(value_id == "Google_TransitStationsMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "grey"), legendgroup = "Arizona", name = "Arizona - Transit Stations",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Arizona") %>%
filter(value_id == "Google_WorkplacesMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "orange"), legendgroup = "Arizona", name = "Arizona - Workplaces",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Arkansas") %>%
filter(value_id == "Google_ParksMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "lime"), legendgroup = "Arkansas", name = "Arkansas - Parks",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Arkansas") %>%
filter(value_id == "Google_RetailMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "blue"), legendgroup = "Arkansas", name = "Arkansas - Retail",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Arkansas") %>%
filter(value_id == "Google_ResidentialMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "brown"), legendgroup = "Arkansas", name = "Arkansas - Residential",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Arkansas") %>%
filter(value_id == "Google_GroceryMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "pink"), legendgroup = "Arkansas", name = "Arkansas - Grocery",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Arkansas") %>%
filter(value_id == "Google_TransitStationsMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "grey"), legendgroup = "Arkansas", name = "Arkansas - Transit Stations",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Arkansas") %>%
filter(value_id == "Google_WorkplacesMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "orange"), legendgroup = "Arkansas", name = "Arkansas - Workplaces",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "California") %>%
filter(value_id == "Google_ParksMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "lime"), legendgroup = "California", name = "California - Parks",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "California") %>%
filter(value_id == "Google_RetailMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "blue"), legendgroup = "California", name = "California - Retail",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "California") %>%
filter(value_id == "Google_ResidentialMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "brown"), legendgroup = "California", name = "California - Residential",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "California") %>%
filter(value_id == "Google_GroceryMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "pink"), legendgroup = "California", name = "California - Grocery",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "California") %>%
filter(value_id == "Google_TransitStationsMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "grey"), legendgroup = "California", name = "California - Transit Stations",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "California") %>%
filter(value_id == "Google_WorkplacesMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "orange"), legendgroup = "California", name = "California - Workplaces",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Colorado") %>%
filter(value_id == "Google_ParksMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "lime"), legendgroup = "Colorado", name = "Colorado - Parks",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Colorado") %>%
filter(value_id == "Google_RetailMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "blue"), legendgroup = "Colorado", name = "Colorado - Retail",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Colorado") %>%
filter(value_id == "Google_ResidentialMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "brown"), legendgroup = "Colorado", name = "Colorado - Residential",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Colorado") %>%
filter(value_id == "Google_GroceryMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "pink"), legendgroup = "Colorado", name = "Colorado - Grocery",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Colorado") %>%
filter(value_id == "Google_TransitStationsMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "grey"), legendgroup = "Colorado", name = "Colorado - Transit Stations",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Colorado") %>%
filter(value_id == "Google_WorkplacesMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "orange"), legendgroup = "Colorado", name = "Colorado - Workplaces",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Connecticut") %>%
filter(value_id == "Google_ParksMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "lime"), legendgroup = "Connecticut", name = "Connecticut - Parks",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Connecticut") %>%
filter(value_id == "Google_RetailMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "blue"), legendgroup = "Connecticut", name = "Connecticut - Retail",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Connecticut") %>%
filter(value_id == "Google_ResidentialMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "brown"), legendgroup = "Connecticut", name = "Connecticut - Residential",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Connecticut") %>%
filter(value_id == "Google_GroceryMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "pink"), legendgroup = "Connecticut", name = "Connecticut - Grocery",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Connecticut") %>%
filter(value_id == "Google_TransitStationsMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "grey"), legendgroup = "Connecticut", name = "Connecticut - Transit Stations",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Connecticut") %>%
filter(value_id == "Google_WorkplacesMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "orange"), legendgroup = "Connecticut", name = "Connecticut - Workplaces",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Delaware") %>%
filter(value_id == "Google_ParksMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "lime"), legendgroup = "Delaware", name = "Delaware - Parks",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Delaware") %>%
filter(value_id == "Google_RetailMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "blue"), legendgroup = "Delaware", name = "Delaware - Retail",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Delaware") %>%
filter(value_id == "Google_ResidentialMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "brown"), legendgroup = "Delaware", name = "Delaware - Residential",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Delaware") %>%
filter(value_id == "Google_GroceryMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "pink"), legendgroup = "Delaware", name = "Delaware - Grocery",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Delaware") %>%
filter(value_id == "Google_TransitStationsMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "grey"), legendgroup = "Delaware", name = "Delaware - Transit Stations",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Delaware") %>%
filter(value_id == "Google_WorkplacesMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "orange"), legendgroup = "Delaware", name = "Delaware - Workplaces",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "DistrictofColumbia") %>%
filter(value_id == "Google_ParksMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "lime"), legendgroup = "DistrictofColumbia",
name = "District of Columbia - Parks", visible = "legendonly") %>% add_trace(data = filter(googlemobility,
name == "DistrictofColumbia") %>% filter(value_id == "Google_RetailMobility"),
opacity = 0.5, type = "scatter", mode = "lines", line = list(color = "blue"),
legendgroup = "DistrictofColumbia", name = "District of Columbia - Retail", visible = "legendonly") %>%
add_trace(data = filter(googlemobility, name == "DistrictofColumbia") %>% filter(value_id ==
"Google_ResidentialMobility"), opacity = 0.5, type = "scatter", mode = "lines",
line = list(color = "brown"), legendgroup = "DistrictofColumbia", name = "District of Columbia - Residential",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name ==
"DistrictofColumbia") %>% filter(value_id == "Google_GroceryMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "pink"), legendgroup = "DistrictofColumbia",
name = "District of Columbia - Grocery", visible = "legendonly") %>% add_trace(data = filter(googlemobility,
name == "DistrictofColumbia") %>% filter(value_id == "Google_TransitStationsMobility"),
opacity = 0.5, type = "scatter", mode = "lines", line = list(color = "grey"),
legendgroup = "DistrictofColumbia", name = "District of Columbia - Transit Stations",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "DistrictofColumbia") %>%
filter(value_id == "Google_WorkplacesMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "orange"), legendgroup = "DistrictofColumbia",
name = "District of Columbia - Workplaces", visible = "legendonly") %>% add_trace(data = filter(googlemobility,
name == "Florida") %>% filter(value_id == "Google_ParksMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "lime"), legendgroup = "Florida",
name = "Florida - Parks", visible = "legendonly") %>% add_trace(data = filter(googlemobility,
name == "Florida") %>% filter(value_id == "Google_RetailMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "blue"), legendgroup = "Florida",
name = "Florida - Retail", visible = "legendonly") %>% add_trace(data = filter(googlemobility,
name == "Florida") %>% filter(value_id == "Google_ResidentialMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "brown"), legendgroup = "Florida",
name = "Florida - Residential", visible = "legendonly") %>% add_trace(data = filter(googlemobility,
name == "Florida") %>% filter(value_id == "Google_GroceryMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "pink"), legendgroup = "Florida",
name = "Florida - Grocery", visible = "legendonly") %>% add_trace(data = filter(googlemobility,
name == "Florida") %>% filter(value_id == "Google_TransitStationsMobility"),
opacity = 0.5, type = "scatter", mode = "lines", line = list(color = "grey"),
legendgroup = "Florida", name = "Florida - Transit Stations", visible = "legendonly") %>%
add_trace(data = filter(googlemobility, name == "Florida") %>% filter(value_id ==
"Google_WorkplacesMobility"), opacity = 0.5, type = "scatter", mode = "lines",
line = list(color = "orange"), legendgroup = "Florida", name = "Florida - Workplaces",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name ==
"Georgia") %>% filter(value_id == "Google_ParksMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "lime"), legendgroup = "Georgia", name = "Georgia - Parks",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Georgia") %>%
filter(value_id == "Google_RetailMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "blue"), legendgroup = "Georgia", name = "Georgia - Retail",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Georgia") %>%
filter(value_id == "Google_ResidentialMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "brown"), legendgroup = "Georgia", name = "Georgia - Residential",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Georgia") %>%
filter(value_id == "Google_GroceryMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "pink"), legendgroup = "Georgia", name = "Georgia - Grocery",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Georgia") %>%
filter(value_id == "Google_TransitStationsMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "grey"), legendgroup = "Georgia", name = "Georgia - Transit Stations",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Georgia") %>%
filter(value_id == "Google_WorkplacesMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "orange"), legendgroup = "Georgia", name = "Georgia - Workplaces",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Idaho") %>%
filter(value_id == "Google_ParksMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "lime"), legendgroup = "Idaho", name = "Idaho - Parks",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Idaho") %>%
filter(value_id == "Google_RetailMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "blue"), legendgroup = "Idaho", name = "Idaho - Retail",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Idaho") %>%
filter(value_id == "Google_ResidentialMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "brown"), legendgroup = "Idaho", name = "Idaho - Residential",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Idaho") %>%
filter(value_id == "Google_GroceryMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "pink"), legendgroup = "Idaho", name = "Idaho - Grocery",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Idaho") %>%
filter(value_id == "Google_TransitStationsMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "grey"), legendgroup = "Idaho", name = "Idaho - Transit Stations",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Idaho") %>%
filter(value_id == "Google_WorkplacesMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "orange"), legendgroup = "Idaho", name = "Idaho - Workplaces",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Illinois") %>%
filter(value_id == "Google_ParksMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "lime"), legendgroup = "Illinois", name = "Illinois - Parks",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Illinois") %>%
filter(value_id == "Google_RetailMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "blue"), legendgroup = "Illinois", name = "Illinois - Retail",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Illinois") %>%
filter(value_id == "Google_ResidentialMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "brown"), legendgroup = "Illinois", name = "Illinois - Residential",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Illinois") %>%
filter(value_id == "Google_GroceryMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "pink"), legendgroup = "Illinois", name = "Illinois - Grocery",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Illinois") %>%
filter(value_id == "Google_TransitStationsMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "grey"), legendgroup = "Illinois", name = "Illinois - Transit Stations",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Illinois") %>%
filter(value_id == "Google_WorkplacesMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "orange"), legendgroup = "Illinois", name = "Illinois - Workplaces",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Indiana") %>%
filter(value_id == "Google_ParksMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "lime"), legendgroup = "Indiana", name = "Indiana - Parks",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Indiana") %>%
filter(value_id == "Google_RetailMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "blue"), legendgroup = "Indiana", name = "Indiana - Retail",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Indiana") %>%
filter(value_id == "Google_ResidentialMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "brown"), legendgroup = "Indiana", name = "Indiana - Residential",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Indiana") %>%
filter(value_id == "Google_GroceryMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "pink"), legendgroup = "Indiana", name = "Indiana - Grocery",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Indiana") %>%
filter(value_id == "Google_TransitStationsMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "grey"), legendgroup = "Indiana", name = "Indiana - Transit Stations",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Indiana") %>%
filter(value_id == "Google_WorkplacesMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "orange"), legendgroup = "Indiana", name = "Indiana - Workplaces",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Iowa") %>%
filter(value_id == "Google_ParksMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "lime"), legendgroup = "Iowa", name = "Iowa - Parks",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Iowa") %>%
filter(value_id == "Google_RetailMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "blue"), legendgroup = "Iowa", name = "Iowa - Retail",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Iowa") %>%
filter(value_id == "Google_ResidentialMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "brown"), legendgroup = "Iowa", name = "Iowa - Residential",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Iowa") %>%
filter(value_id == "Google_GroceryMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "pink"), legendgroup = "Iowa", name = "Iowa - Grocery",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Iowa") %>%
filter(value_id == "Google_TransitStationsMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "grey"), legendgroup = "Iowa", name = "Iowa - Transit Stations",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Iowa") %>%
filter(value_id == "Google_WorkplacesMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "orange"), legendgroup = "Iowa", name = "Iowa - Workplaces",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Kansas") %>%
filter(value_id == "Google_ParksMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "lime"), legendgroup = "Kansas", name = "Kansas - Parks",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Kansas") %>%
filter(value_id == "Google_RetailMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "blue"), legendgroup = "Kansas", name = "Kansas - Retail",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Kansas") %>%
filter(value_id == "Google_ResidentialMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "brown"), legendgroup = "Kansas", name = "Kansas - Residential",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Kansas") %>%
filter(value_id == "Google_GroceryMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "pink"), legendgroup = "Kansas", name = "Kansas - Grocery",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Kansas") %>%
filter(value_id == "Google_TransitStationsMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "grey"), legendgroup = "Kansas", name = "Kansas - Transit Stations",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Kansas") %>%
filter(value_id == "Google_WorkplacesMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "orange"), legendgroup = "Kansas", name = "Kansas - Workplaces",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Kentucky") %>%
filter(value_id == "Google_ParksMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "lime"), legendgroup = "Kentucky", name = "Kentucky - Parks",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Kentucky") %>%
filter(value_id == "Google_RetailMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "blue"), legendgroup = "Kentucky", name = "Kentucky - Retail",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Kentucky") %>%
filter(value_id == "Google_ResidentialMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "brown"), legendgroup = "Kentucky", name = "Kentucky - Residential",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Kentucky") %>%
filter(value_id == "Google_GroceryMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "pink"), legendgroup = "Kentucky", name = "Kentucky - Grocery",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Kentucky") %>%
filter(value_id == "Google_TransitStationsMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "grey"), legendgroup = "Kentucky", name = "Kentucky - Transit Stations",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Kentucky") %>%
filter(value_id == "Google_WorkplacesMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "orange"), legendgroup = "Kentucky", name = "Kentucky - Workplaces",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Louisiana") %>%
filter(value_id == "Google_ParksMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "lime"), legendgroup = "Louisiana", name = "Louisiana - Parks",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Louisiana") %>%
filter(value_id == "Google_RetailMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "blue"), legendgroup = "Louisiana", name = "Louisiana - Retail",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Louisiana") %>%
filter(value_id == "Google_ResidentialMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "brown"), legendgroup = "Louisiana", name = "Louisiana - Residential",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Louisiana") %>%
filter(value_id == "Google_GroceryMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "pink"), legendgroup = "Louisiana", name = "Louisiana - Grocery",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Louisiana") %>%
filter(value_id == "Google_TransitStationsMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "grey"), legendgroup = "Louisiana", name = "Louisiana - Transit Stations",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Louisiana") %>%
filter(value_id == "Google_WorkplacesMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "orange"), legendgroup = "Louisiana", name = "Louisiana - Workplaces",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Maine") %>%
filter(value_id == "Google_ParksMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "lime"), legendgroup = "Maine", name = "Maine - Parks",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Maine") %>%
filter(value_id == "Google_RetailMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "blue"), legendgroup = "Maine", name = "Maine - Retail",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Maine") %>%
filter(value_id == "Google_ResidentialMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "brown"), legendgroup = "Maine", name = "Maine - Residential",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Maine") %>%
filter(value_id == "Google_GroceryMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "pink"), legendgroup = "Maine", name = "Maine - Grocery",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Maine") %>%
filter(value_id == "Google_TransitStationsMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "grey"), legendgroup = "Maine", name = "Maine - Transit Stations",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Maine") %>%
filter(value_id == "Google_WorkplacesMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "orange"), legendgroup = "Maine", name = "Maine - Workplaces",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Maryland") %>%
filter(value_id == "Google_ParksMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "lime"), legendgroup = "Maryland", name = "Maryland - Parks",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Maryland") %>%
filter(value_id == "Google_RetailMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "blue"), legendgroup = "Maryland", name = "Maryland - Retail",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Maryland") %>%
filter(value_id == "Google_ResidentialMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "brown"), legendgroup = "Maryland", name = "Maryland - Residential",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Maryland") %>%
filter(value_id == "Google_GroceryMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "pink"), legendgroup = "Maryland", name = "Maryland - Grocery",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Maryland") %>%
filter(value_id == "Google_TransitStationsMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "grey"), legendgroup = "Maryland", name = "Maryland - Transit Stations",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Maryland") %>%
filter(value_id == "Google_WorkplacesMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "orange"), legendgroup = "Maryland", name = "Maryland - Workplaces",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Massachusetts") %>%
filter(value_id == "Google_ParksMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "lime"), legendgroup = "Massachusetts", name = "Massachusetts - Parks",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Massachusetts") %>%
filter(value_id == "Google_RetailMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "blue"), legendgroup = "Massachusetts", name = "Massachusetts - Retail",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Massachusetts") %>%
filter(value_id == "Google_ResidentialMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "brown"), legendgroup = "Massachusetts",
name = "Massachusetts - Residential", visible = "legendonly") %>% add_trace(data = filter(googlemobility,
name == "Massachusetts") %>% filter(value_id == "Google_GroceryMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "pink"), legendgroup = "Massachusetts",
name = "Massachusetts - Grocery", visible = "legendonly") %>% add_trace(data = filter(googlemobility,
name == "Massachusetts") %>% filter(value_id == "Google_TransitStationsMobility"),
opacity = 0.5, type = "scatter", mode = "lines", line = list(color = "grey"),
legendgroup = "Massachusetts", name = "Massachusetts - Transit Stations", visible = "legendonly") %>%
add_trace(data = filter(googlemobility, name == "Massachusetts") %>% filter(value_id ==
"Google_WorkplacesMobility"), opacity = 0.5, type = "scatter", mode = "lines",
line = list(color = "orange"), legendgroup = "Massachusetts", name = "Massachusetts - Workplaces",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name ==
"Michigan") %>% filter(value_id == "Google_ParksMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "lime"), legendgroup = "Michigan", name = "Michigan - Parks",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Michigan") %>%
filter(value_id == "Google_RetailMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "blue"), legendgroup = "Michigan", name = "Michigan - Retail",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Michigan") %>%
filter(value_id == "Google_ResidentialMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "brown"), legendgroup = "Michigan", name = "Michigan - Residential",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Michigan") %>%
filter(value_id == "Google_GroceryMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "pink"), legendgroup = "Michigan", name = "Michigan - Grocery",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Michigan") %>%
filter(value_id == "Google_TransitStationsMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "grey"), legendgroup = "Michigan", name = "Michigan - Transit Stations",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Michigan") %>%
filter(value_id == "Google_WorkplacesMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "orange"), legendgroup = "Michigan", name = "Michigan - Workplaces",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Minnesota") %>%
filter(value_id == "Google_ParksMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "lime"), legendgroup = "Minnesota", name = "Minnesota - Parks",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Minnesota") %>%
filter(value_id == "Google_RetailMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "blue"), legendgroup = "Minnesota", name = "Minnesota - Retail",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Minnesota") %>%
filter(value_id == "Google_ResidentialMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "brown"), legendgroup = "Minnesota", name = "Minnesota - Residential",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Minnesota") %>%
filter(value_id == "Google_GroceryMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "pink"), legendgroup = "Minnesota", name = "Minnesota - Grocery",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Minnesota") %>%
filter(value_id == "Google_TransitStationsMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "grey"), legendgroup = "Minnesota", name = "Minnesota - Transit Stations",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Minnesota") %>%
filter(value_id == "Google_WorkplacesMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "orange"), legendgroup = "Minnesota", name = "Minnesota - Workplaces",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Mississippi") %>%
filter(value_id == "Google_ParksMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "lime"), legendgroup = "Mississippi", name = "Mississippi - Parks",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Mississippi") %>%
filter(value_id == "Google_RetailMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "blue"), legendgroup = "Mississippi", name = "Mississippi - Retail",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Mississippi") %>%
filter(value_id == "Google_ResidentialMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "brown"), legendgroup = "Mississippi", name = "Mississippi - Residential",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Mississippi") %>%
filter(value_id == "Google_GroceryMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "pink"), legendgroup = "Mississippi", name = "Mississippi - Grocery",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Mississippi") %>%
filter(value_id == "Google_TransitStationsMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "grey"), legendgroup = "Mississippi", name = "Mississippi - Transit Stations",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Mississippi") %>%
filter(value_id == "Google_WorkplacesMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "orange"), legendgroup = "Mississippi", name = "Mississippi - Workplaces",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Missouri") %>%
filter(value_id == "Google_ParksMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "lime"), legendgroup = "Missouri", name = "Missouri - Parks",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Missouri") %>%
filter(value_id == "Google_RetailMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "blue"), legendgroup = "Missouri", name = "Missouri - Retail",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Missouri") %>%
filter(value_id == "Google_ResidentialMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "brown"), legendgroup = "Missouri", name = "Missouri - Residential",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Missouri") %>%
filter(value_id == "Google_GroceryMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "pink"), legendgroup = "Missouri", name = "Missouri - Grocery",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Missouri") %>%
filter(value_id == "Google_TransitStationsMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "grey"), legendgroup = "Missouri", name = "Missouri - Transit Stations",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Missouri") %>%
filter(value_id == "Google_WorkplacesMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "orange"), legendgroup = "Missouri", name = "Missouri - Workplaces",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Montana") %>%
filter(value_id == "Google_ParksMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "lime"), legendgroup = "Montana", name = "Montana - Parks",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Montana") %>%
filter(value_id == "Google_RetailMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "blue"), legendgroup = "Montana", name = "Montana - Retail",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Montana") %>%
filter(value_id == "Google_ResidentialMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "brown"), legendgroup = "Montana", name = "Montana - Residential",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Montana") %>%
filter(value_id == "Google_GroceryMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "pink"), legendgroup = "Montana", name = "Montana - Grocery",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Montana") %>%
filter(value_id == "Google_TransitStationsMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "grey"), legendgroup = "Montana", name = "Montana - Transit Stations",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Montana") %>%
filter(value_id == "Google_WorkplacesMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "orange"), legendgroup = "Montana", name = "Montana - Workplaces",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Nebraska") %>%
filter(value_id == "Google_ParksMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "lime"), legendgroup = "Nebraska", name = "Nebraska - Parks",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Nebraska") %>%
filter(value_id == "Google_RetailMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "blue"), legendgroup = "Nebraska", name = "Nebraska - Retail",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Nebraska") %>%
filter(value_id == "Google_ResidentialMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "brown"), legendgroup = "Nebraska", name = "Nebraska - Residential",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Nebraska") %>%
filter(value_id == "Google_GroceryMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "pink"), legendgroup = "Nebraska", name = "Nebraska - Grocery",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Nebraska") %>%
filter(value_id == "Google_TransitStationsMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "grey"), legendgroup = "Nebraska", name = "Nebraska - Transit Stations",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Nebraska") %>%
filter(value_id == "Google_WorkplacesMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "orange"), legendgroup = "Nebraska", name = "Nebraska - Workplaces",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Nevada") %>%
filter(value_id == "Google_ParksMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "lime"), legendgroup = "Nevada", name = "Nevada - Parks",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Nevada") %>%
filter(value_id == "Google_RetailMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "blue"), legendgroup = "Nevada", name = "Nevada - Retail",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Nevada") %>%
filter(value_id == "Google_ResidentialMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "brown"), legendgroup = "Nevada", name = "Nevada - Residential",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Nevada") %>%
filter(value_id == "Google_GroceryMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "pink"), legendgroup = "Nevada", name = "Nevada - Grocery",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Nevada") %>%
filter(value_id == "Google_TransitStationsMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "grey"), legendgroup = "Nevada", name = "Nevada - Transit Stations",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Nevada") %>%
filter(value_id == "Google_WorkplacesMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "orange"), legendgroup = "Nevada", name = "Nevada - Workplaces",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "NewHampshire") %>%
filter(value_id == "Google_ParksMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "lime"), legendgroup = "NewHampshire", name = "New Hampshire - Parks",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "NewHampshire") %>%
filter(value_id == "Google_RetailMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "blue"), legendgroup = "NewHampshire", name = "New Hampshire - Retail",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "NewHampshire") %>%
filter(value_id == "Google_ResidentialMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "brown"), legendgroup = "NewHampshire", name = "New Hampshire - Residential",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "NewHampshire") %>%
filter(value_id == "Google_GroceryMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "pink"), legendgroup = "NewHampshire", name = "New Hampshire - Grocery",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "NewHampshire") %>%
filter(value_id == "Google_TransitStationsMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "grey"), legendgroup = "NewHampshire", name = "New Hampshire - Transit Stations",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "NewHampshire") %>%
filter(value_id == "Google_WorkplacesMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "orange"), legendgroup = "NewHampshire",
name = "New Hampshire - Workplaces", visible = "legendonly") %>% add_trace(data = filter(googlemobility,
name == "NewJersey") %>% filter(value_id == "Google_ParksMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "lime"), legendgroup = "NewJersey",
name = "New Jersey - Parks", visible = "legendonly") %>% add_trace(data = filter(googlemobility,
name == "NewJersey") %>% filter(value_id == "Google_RetailMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "blue"), legendgroup = "NewJersey",
name = "New Jersey - Retail", visible = "legendonly") %>% add_trace(data = filter(googlemobility,
name == "NewJersey") %>% filter(value_id == "Google_ResidentialMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "brown"), legendgroup = "NewJersey",
name = "New Jersey - Residential", visible = "legendonly") %>% add_trace(data = filter(googlemobility,
name == "NewJersey") %>% filter(value_id == "Google_GroceryMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "pink"), legendgroup = "NewJersey",
name = "New Jersey - Grocery", visible = "legendonly") %>% add_trace(data = filter(googlemobility,
name == "NewJersey") %>% filter(value_id == "Google_TransitStationsMobility"),
opacity = 0.5, type = "scatter", mode = "lines", line = list(color = "grey"),
legendgroup = "NewJersey", name = "New Jersey - Transit Stations", visible = "legendonly") %>%
add_trace(data = filter(googlemobility, name == "NewJersey") %>% filter(value_id ==
"Google_WorkplacesMobility"), opacity = 0.5, type = "scatter", mode = "lines",
line = list(color = "orange"), legendgroup = "NewJersey", name = "New Jersey - Workplaces",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name ==
"NewMexico") %>% filter(value_id == "Google_ParksMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "lime"), legendgroup = "NewMexico", name = "New Mexico - Parks",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "NewMexico") %>%
filter(value_id == "Google_RetailMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "blue"), legendgroup = "NewMexico", name = "New Mexico - Retail",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "NewMexico") %>%
filter(value_id == "Google_ResidentialMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "brown"), legendgroup = "NewMexico", name = "New Mexico - Residential",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "NewMexico") %>%
filter(value_id == "Google_GroceryMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "pink"), legendgroup = "NewMexico", name = "New Mexico - Grocery",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "NewMexico") %>%
filter(value_id == "Google_TransitStationsMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "grey"), legendgroup = "NewMexico", name = "New Mexico - Transit Stations",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "NewMexico") %>%
filter(value_id == "Google_WorkplacesMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "orange"), legendgroup = "NewMexico", name = "New Mexico - Workplaces",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "NewYork") %>%
filter(value_id == "Google_ParksMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "lime"), legendgroup = "NewYork", name = "New York - Parks",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "NewYork") %>%
filter(value_id == "Google_RetailMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "blue"), legendgroup = "NewYork", name = "New York - Retail",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "NewYork") %>%
filter(value_id == "Google_ResidentialMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "brown"), legendgroup = "NewYork", name = "New York - Residential",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "NewYork") %>%
filter(value_id == "Google_GroceryMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "pink"), legendgroup = "NewYork", name = "New York - Grocery",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "NewYork") %>%
filter(value_id == "Google_TransitStationsMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "grey"), legendgroup = "NewYork", name = "New York - Transit Stations",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "NewYork") %>%
filter(value_id == "Google_WorkplacesMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "orange"), legendgroup = "NewYork", name = "New York - Workplaces",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "NorthCarolina") %>%
filter(value_id == "Google_ParksMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "lime"), legendgroup = "NorthCarolina", name = "North Carolina - Parks",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "NorthCarolina") %>%
filter(value_id == "Google_RetailMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "blue"), legendgroup = "NorthCarolina", name = "North Carolina - Retail",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "NorthCarolina") %>%
filter(value_id == "Google_ResidentialMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "brown"), legendgroup = "NorthCarolina",
name = "North Carolina - Residential", visible = "legendonly") %>% add_trace(data = filter(googlemobility,
name == "NorthCarolina") %>% filter(value_id == "Google_GroceryMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "pink"), legendgroup = "NorthCarolina",
name = "North Carolina - Grocery", visible = "legendonly") %>% add_trace(data = filter(googlemobility,
name == "NorthCarolina") %>% filter(value_id == "Google_TransitStationsMobility"),
opacity = 0.5, type = "scatter", mode = "lines", line = list(color = "grey"),
legendgroup = "NorthCarolina", name = "North Carolina - Transit Stations", visible = "legendonly") %>%
add_trace(data = filter(googlemobility, name == "NorthCarolina") %>% filter(value_id ==
"Google_WorkplacesMobility"), opacity = 0.5, type = "scatter", mode = "lines",
line = list(color = "orange"), legendgroup = "NorthCarolina", name = "North Carolina - Workplaces",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name ==
"NorthDakota") %>% filter(value_id == "Google_ParksMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "lime"), legendgroup = "NorthDakota",
name = "NorthDakota - Parks", visible = "legendonly") %>% add_trace(data = filter(googlemobility,
name == "NorthDakota") %>% filter(value_id == "Google_RetailMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "blue"), legendgroup = "NorthDakota",
name = "NorthDakota - Retail", visible = "legendonly") %>% add_trace(data = filter(googlemobility,
name == "NorthDakota") %>% filter(value_id == "Google_ResidentialMobility"),
opacity = 0.5, type = "scatter", mode = "lines", line = list(color = "brown"),
legendgroup = "NorthDakota", name = "NorthDakota - Residential", visible = "legendonly") %>%
add_trace(data = filter(googlemobility, name == "NorthDakota") %>% filter(value_id ==
"Google_GroceryMobility"), opacity = 0.5, type = "scatter", mode = "lines",
line = list(color = "pink"), legendgroup = "NorthDakota", name = "NorthDakota - Grocery",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name ==
"NorthDakota") %>% filter(value_id == "Google_TransitStationsMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "grey"), legendgroup = "NorthDakota",
name = "NorthDakota - Transit Stations", visible = "legendonly") %>% add_trace(data = filter(googlemobility,
name == "NorthDakota") %>% filter(value_id == "Google_WorkplacesMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "orange"), legendgroup = "NorthDakota",
name = "NorthDakota - Workplaces", visible = "legendonly") %>% add_trace(data = filter(googlemobility,
name == "Ohio") %>% filter(value_id == "Google_ParksMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "lime"), legendgroup = "Ohio",
name = "Ohio - Parks", visible = "legendonly") %>% add_trace(data = filter(googlemobility,
name == "Ohio") %>% filter(value_id == "Google_RetailMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "blue"), legendgroup = "Ohio",
name = "Ohio - Retail", visible = "legendonly") %>% add_trace(data = filter(googlemobility,
name == "Ohio") %>% filter(value_id == "Google_ResidentialMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "brown"), legendgroup = "Ohio",
name = "Ohio - Residential", visible = "legendonly") %>% add_trace(data = filter(googlemobility,
name == "Ohio") %>% filter(value_id == "Google_GroceryMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "pink"), legendgroup = "Ohio",
name = "Ohio - Grocery", visible = "legendonly") %>% add_trace(data = filter(googlemobility,
name == "Ohio") %>% filter(value_id == "Google_TransitStationsMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "grey"), legendgroup = "Ohio",
name = "Ohio - Transit Stations", visible = "legendonly") %>% add_trace(data = filter(googlemobility,
name == "Ohio") %>% filter(value_id == "Google_WorkplacesMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "orange"), legendgroup = "Ohio",
name = "Ohio - Workplaces", visible = "legendonly") %>% add_trace(data = filter(googlemobility,
name == "Oklahoma") %>% filter(value_id == "Google_ParksMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "lime"), legendgroup = "Oklahoma",
name = "Oklahoma - Parks", visible = "legendonly") %>% add_trace(data = filter(googlemobility,
name == "Oklahoma") %>% filter(value_id == "Google_RetailMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "blue"), legendgroup = "Oklahoma",
name = "Oklahoma - Retail", visible = "legendonly") %>% add_trace(data = filter(googlemobility,
name == "Oklahoma") %>% filter(value_id == "Google_ResidentialMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "brown"), legendgroup = "Oklahoma",
name = "Oklahoma - Residential", visible = "legendonly") %>% add_trace(data = filter(googlemobility,
name == "Oklahoma") %>% filter(value_id == "Google_GroceryMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "pink"), legendgroup = "Oklahoma",
name = "Oklahoma - Grocery", visible = "legendonly") %>% add_trace(data = filter(googlemobility,
name == "Oklahoma") %>% filter(value_id == "Google_TransitStationsMobility"),
opacity = 0.5, type = "scatter", mode = "lines", line = list(color = "grey"),
legendgroup = "Oklahoma", name = "Oklahoma - Transit Stations", visible = "legendonly") %>%
add_trace(data = filter(googlemobility, name == "Oklahoma") %>% filter(value_id ==
"Google_WorkplacesMobility"), opacity = 0.5, type = "scatter", mode = "lines",
line = list(color = "orange"), legendgroup = "Oklahoma", name = "Oklahoma - Workplaces",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name ==
"Oregon") %>% filter(value_id == "Google_ParksMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "lime"), legendgroup = "Oregon", name = "Oregon - Parks",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Oregon") %>%
filter(value_id == "Google_RetailMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "blue"), legendgroup = "Oregon", name = "Oregon - Retail",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Oregon") %>%
filter(value_id == "Google_ResidentialMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "brown"), legendgroup = "Oregon", name = "Oregon - Residential",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Oregon") %>%
filter(value_id == "Google_GroceryMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "pink"), legendgroup = "Oregon", name = "Oregon - Grocery",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Oregon") %>%
filter(value_id == "Google_TransitStationsMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "grey"), legendgroup = "Oregon", name = "Oregon - Transit Stations",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Oregon") %>%
filter(value_id == "Google_WorkplacesMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "orange"), legendgroup = "Oregon", name = "Oregon - Workplaces",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Pennsylvania") %>%
filter(value_id == "Google_ParksMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "lime"), legendgroup = "Pennsylvania", name = "Pennsylvania - Parks",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Pennsylvania") %>%
filter(value_id == "Google_RetailMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "blue"), legendgroup = "Pennsylvania", name = "Pennsylvania - Retail",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Pennsylvania") %>%
filter(value_id == "Google_ResidentialMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "brown"), legendgroup = "Pennsylvania", name = "Pennsylvania - Residential",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Pennsylvania") %>%
filter(value_id == "Google_GroceryMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "pink"), legendgroup = "Pennsylvania", name = "Pennsylvania - Grocery",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Pennsylvania") %>%
filter(value_id == "Google_TransitStationsMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "grey"), legendgroup = "Pennsylvania", name = "Pennsylvania - Transit Stations",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Pennsylvania") %>%
filter(value_id == "Google_WorkplacesMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "orange"), legendgroup = "Pennsylvania",
name = "Pennsylvania - Workplaces", visible = "legendonly") %>% add_trace(data = filter(googlemobility,
name == "PuertoRico") %>% filter(value_id == "Google_ParksMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "lime"), legendgroup = "PuertoRico",
name = "Puerto Rico - Parks", visible = "legendonly") %>% add_trace(data = filter(googlemobility,
name == "PuertoRico") %>% filter(value_id == "Google_RetailMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "blue"), legendgroup = "PuertoRico",
name = "Puerto Rico - Retail", visible = "legendonly") %>% add_trace(data = filter(googlemobility,
name == "PuertoRico") %>% filter(value_id == "Google_ResidentialMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "brown"), legendgroup = "PuertoRico",
name = "Puerto Rico - Residential", visible = "legendonly") %>% add_trace(data = filter(googlemobility,
name == "PuertoRico") %>% filter(value_id == "Google_GroceryMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "pink"), legendgroup = "PuertoRico",
name = "Puerto Rico - Grocery", visible = "legendonly") %>% add_trace(data = filter(googlemobility,
name == "PuertoRico") %>% filter(value_id == "Google_TransitStationsMobility"),
opacity = 0.5, type = "scatter", mode = "lines", line = list(color = "grey"),
legendgroup = "PuertoRico", name = "Puerto Rico - Transit Stations", visible = "legendonly") %>%
add_trace(data = filter(googlemobility, name == "PuertoRico") %>% filter(value_id ==
"Google_WorkplacesMobility"), opacity = 0.5, type = "scatter", mode = "lines",
line = list(color = "orange"), legendgroup = "PuertoRico", name = "Puerto Rico - Workplaces",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name ==
"RhodeIsland") %>% filter(value_id == "Google_ParksMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "lime"), legendgroup = "RhodeIsland",
name = "Rhode Island - Parks", visible = "legendonly") %>% add_trace(data = filter(googlemobility,
name == "RhodeIsland") %>% filter(value_id == "Google_RetailMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "blue"), legendgroup = "RhodeIsland",
name = "Rhode Island - Retail", visible = "legendonly") %>% add_trace(data = filter(googlemobility,
name == "RhodeIsland") %>% filter(value_id == "Google_ResidentialMobility"),
opacity = 0.5, type = "scatter", mode = "lines", line = list(color = "brown"),
legendgroup = "RhodeIsland", name = "Rhode Island - Residential", visible = "legendonly") %>%
add_trace(data = filter(googlemobility, name == "RhodeIsland") %>% filter(value_id ==
"Google_GroceryMobility"), opacity = 0.5, type = "scatter", mode = "lines",
line = list(color = "pink"), legendgroup = "RhodeIsland", name = "Rhode Island - Grocery",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name ==
"RhodeIsland") %>% filter(value_id == "Google_TransitStationsMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "grey"), legendgroup = "RhodeIsland",
name = "Rhode Island - Transit Stations", visible = "legendonly") %>% add_trace(data = filter(googlemobility,
name == "RhodeIsland") %>% filter(value_id == "Google_WorkplacesMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "orange"), legendgroup = "RhodeIsland",
name = "Rhode Island - Workplaces", visible = "legendonly") %>% add_trace(data = filter(googlemobility,
name == "SouthCarolina") %>% filter(value_id == "Google_ParksMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "lime"), legendgroup = "SouthCarolina",
name = "South Carolina - Parks", visible = "legendonly") %>% add_trace(data = filter(googlemobility,
name == "SouthCarolina") %>% filter(value_id == "Google_RetailMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "blue"), legendgroup = "SouthCarolina",
name = "South Carolina - Retail", visible = "legendonly") %>% add_trace(data = filter(googlemobility,
name == "SouthCarolina") %>% filter(value_id == "Google_ResidentialMobility"),
opacity = 0.5, type = "scatter", mode = "lines", line = list(color = "brown"),
legendgroup = "SouthCarolina", name = "South Carolina - Residential", visible = "legendonly") %>%
add_trace(data = filter(googlemobility, name == "SouthCarolina") %>% filter(value_id ==
"Google_GroceryMobility"), opacity = 0.5, type = "scatter", mode = "lines",
line = list(color = "pink"), legendgroup = "SouthCarolina", name = "South Carolina - Grocery",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name ==
"SouthCarolina") %>% filter(value_id == "Google_TransitStationsMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "grey"), legendgroup = "SouthCarolina",
name = "South Carolina - Transit Stations", visible = "legendonly") %>% add_trace(data = filter(googlemobility,
name == "SouthCarolina") %>% filter(value_id == "Google_WorkplacesMobility"),
opacity = 0.5, type = "scatter", mode = "lines", line = list(color = "orange"),
legendgroup = "SouthCarolina", name = "South Carolina - Workplaces", visible = "legendonly") %>%
add_trace(data = filter(googlemobility, name == "SouthDakota") %>% filter(value_id ==
"Google_ParksMobility"), opacity = 0.5, type = "scatter", mode = "lines",
line = list(color = "lime"), legendgroup = "SouthDakota", name = "South Dakota - Parks",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name ==
"SouthDakota") %>% filter(value_id == "Google_RetailMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "blue"), legendgroup = "SouthDakota",
name = "South Dakota - Retail", visible = "legendonly") %>% add_trace(data = filter(googlemobility,
name == "SouthDakota") %>% filter(value_id == "Google_ResidentialMobility"),
opacity = 0.5, type = "scatter", mode = "lines", line = list(color = "brown"),
legendgroup = "SouthDakota", name = "South Dakota - Residential", visible = "legendonly") %>%
add_trace(data = filter(googlemobility, name == "SouthDakota") %>% filter(value_id ==
"Google_GroceryMobility"), opacity = 0.5, type = "scatter", mode = "lines",
line = list(color = "pink"), legendgroup = "SouthDakota", name = "South Dakota - Grocery",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name ==
"SouthDakota") %>% filter(value_id == "Google_TransitStationsMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "grey"), legendgroup = "SouthDakota",
name = "South Dakota - Transit Stations", visible = "legendonly") %>% add_trace(data = filter(googlemobility,
name == "SouthDakota") %>% filter(value_id == "Google_WorkplacesMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "orange"), legendgroup = "SouthDakota",
name = "South Dakota - Workplaces", visible = "legendonly") %>% add_trace(data = filter(googlemobility,
name == "Tennessee") %>% filter(value_id == "Google_ParksMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "lime"), legendgroup = "Tennessee",
name = "Tennessee - Parks", visible = "legendonly") %>% add_trace(data = filter(googlemobility,
name == "Tennessee") %>% filter(value_id == "Google_RetailMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "blue"), legendgroup = "Tennessee",
name = "Tennessee - Retail", visible = "legendonly") %>% add_trace(data = filter(googlemobility,
name == "Tennessee") %>% filter(value_id == "Google_ResidentialMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "brown"), legendgroup = "Tennessee",
name = "Tennessee - Residential", visible = "legendonly") %>% add_trace(data = filter(googlemobility,
name == "Tennessee") %>% filter(value_id == "Google_GroceryMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "pink"), legendgroup = "Tennessee",
name = "Tennessee - Grocery", visible = "legendonly") %>% add_trace(data = filter(googlemobility,
name == "Tennessee") %>% filter(value_id == "Google_TransitStationsMobility"),
opacity = 0.5, type = "scatter", mode = "lines", line = list(color = "grey"),
legendgroup = "Tennessee", name = "Tennessee - Transit Stations", visible = "legendonly") %>%
add_trace(data = filter(googlemobility, name == "Tennessee") %>% filter(value_id ==
"Google_WorkplacesMobility"), opacity = 0.5, type = "scatter", mode = "lines",
line = list(color = "orange"), legendgroup = "Tennessee", name = "Tennessee - Workplaces",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name ==
"Texas") %>% filter(value_id == "Google_ParksMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "lime"), legendgroup = "Texas", name = "Texas - Parks",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Texas") %>%
filter(value_id == "Google_RetailMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "blue"), legendgroup = "Texas", name = "Texas - Retail",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Texas") %>%
filter(value_id == "Google_ResidentialMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "brown"), legendgroup = "Texas", name = "Texas - Residential",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Texas") %>%
filter(value_id == "Google_GroceryMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "pink"), legendgroup = "Texas", name = "Texas - Grocery",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Texas") %>%
filter(value_id == "Google_TransitStationsMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "grey"), legendgroup = "Texas", name = "Texas - Transit Stations",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Texas") %>%
filter(value_id == "Google_WorkplacesMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "orange"), legendgroup = "Texas", name = "Texas - Workplaces",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Utah") %>%
filter(value_id == "Google_ParksMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "lime"), legendgroup = "Utah", name = "Utah - Parks",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Utah") %>%
filter(value_id == "Google_RetailMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "blue"), legendgroup = "Utah", name = "Utah - Retail",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Utah") %>%
filter(value_id == "Google_ResidentialMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "brown"), legendgroup = "Utah", name = "Utah - Residential",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Utah") %>%
filter(value_id == "Google_GroceryMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "pink"), legendgroup = "Utah", name = "Utah - Grocery",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Utah") %>%
filter(value_id == "Google_TransitStationsMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "grey"), legendgroup = "Utah", name = "Utah - Transit Stations",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Utah") %>%
filter(value_id == "Google_WorkplacesMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "orange"), legendgroup = "Utah", name = "Utah - Workplaces",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Vermont") %>%
filter(value_id == "Google_ParksMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "lime"), legendgroup = "Vermont", name = "Vermont - Parks",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Vermont") %>%
filter(value_id == "Google_RetailMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "blue"), legendgroup = "Vermont", name = "Vermont - Retail",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Vermont") %>%
filter(value_id == "Google_ResidentialMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "brown"), legendgroup = "Vermont", name = "Vermont - Residential",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Vermont") %>%
filter(value_id == "Google_GroceryMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "pink"), legendgroup = "Vermont", name = "Vermont - Grocery",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Vermont") %>%
filter(value_id == "Google_TransitStationsMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "grey"), legendgroup = "Vermont", name = "Vermont - Transit Stations",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Vermont") %>%
filter(value_id == "Google_WorkplacesMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "orange"), legendgroup = "Vermont", name = "Vermont - Workplaces",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Virginia") %>%
filter(value_id == "Google_ParksMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "lime"), legendgroup = "Virginia", name = "Virginia - Parks",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Virginia") %>%
filter(value_id == "Google_RetailMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "blue"), legendgroup = "Virginia", name = "Virginia - Retail",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Virginia") %>%
filter(value_id == "Google_ResidentialMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "brown"), legendgroup = "Virginia", name = "Virginia - Residential",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Virginia") %>%
filter(value_id == "Google_GroceryMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "pink"), legendgroup = "Virginia", name = "Virginia - Grocery",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Virginia") %>%
filter(value_id == "Google_TransitStationsMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "grey"), legendgroup = "Virginia", name = "Virginia - Transit Stations",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Virginia") %>%
filter(value_id == "Google_WorkplacesMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "orange"), legendgroup = "Virginia", name = "Virginia - Workplaces",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Washington") %>%
filter(value_id == "Google_ParksMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "lime"), legendgroup = "Washington", name = "Washington - Parks",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Washington") %>%
filter(value_id == "Google_RetailMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "blue"), legendgroup = "Washington", name = "Washington - Retail",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Washington") %>%
filter(value_id == "Google_ResidentialMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "brown"), legendgroup = "Washington", name = "Washington - Residential",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Washington") %>%
filter(value_id == "Google_GroceryMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "pink"), legendgroup = "Washington", name = "Washington - Grocery",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Washington") %>%
filter(value_id == "Google_TransitStationsMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "grey"), legendgroup = "Washington", name = "Washington - Transit Stations",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Washington") %>%
filter(value_id == "Google_WorkplacesMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "orange"), legendgroup = "Washington", name = "Washington - Workplaces",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "WestVirginia") %>%
filter(value_id == "Google_ParksMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "lime"), legendgroup = "WestVirginia", name = "West Virginia - Parks",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "WestVirginia") %>%
filter(value_id == "Google_RetailMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "blue"), legendgroup = "WestVirginia", name = "West Virginia - Retail",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "WestVirginia") %>%
filter(value_id == "Google_ResidentialMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "brown"), legendgroup = "WestVirginia", name = "West Virginia - Residential",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "WestVirginia") %>%
filter(value_id == "Google_GroceryMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "pink"), legendgroup = "WestVirginia", name = "West Virginia - Grocery",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "WestVirginia") %>%
filter(value_id == "Google_TransitStationsMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "grey"), legendgroup = "WestVirginia", name = "West Virginia - Transit Stations",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "WestVirginia") %>%
filter(value_id == "Google_WorkplacesMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "orange"), legendgroup = "WestVirginia",
name = "West Virginia - Workplaces", visible = "legendonly") %>% add_trace(data = filter(googlemobility,
name == "Wisconsin") %>% filter(value_id == "Google_ParksMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "lime"), legendgroup = "Wisconsin",
name = "Wisconsin - Parks", visible = "legendonly") %>% add_trace(data = filter(googlemobility,
name == "Wisconsin") %>% filter(value_id == "Google_RetailMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "blue"), legendgroup = "Wisconsin",
name = "Wisconsin - Retail", visible = "legendonly") %>% add_trace(data = filter(googlemobility,
name == "Wisconsin") %>% filter(value_id == "Google_ResidentialMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "brown"), legendgroup = "Wisconsin",
name = "Wisconsin - Residential", visible = "legendonly") %>% add_trace(data = filter(googlemobility,
name == "Wisconsin") %>% filter(value_id == "Google_GroceryMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "pink"), legendgroup = "Wisconsin",
name = "Wisconsin - Grocery", visible = "legendonly") %>% add_trace(data = filter(googlemobility,
name == "Wisconsin") %>% filter(value_id == "Google_TransitStationsMobility"),
opacity = 0.5, type = "scatter", mode = "lines", line = list(color = "grey"),
legendgroup = "Wisconsin", name = "Wisconsin - Transit Stations", visible = "legendonly") %>%
add_trace(data = filter(googlemobility, name == "Wisconsin") %>% filter(value_id ==
"Google_WorkplacesMobility"), opacity = 0.5, type = "scatter", mode = "lines",
line = list(color = "orange"), legendgroup = "Wisconsin", name = "Wisconsin - Workplaces",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name ==
"Wyoming") %>% filter(value_id == "Google_ParksMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "lime"), legendgroup = "Wyoming", name = "Wyoming - Parks",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Wyoming") %>%
filter(value_id == "Google_RetailMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "blue"), legendgroup = "Wyoming", name = "Wyoming - Retail",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Wyoming") %>%
filter(value_id == "Google_ResidentialMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "brown"), legendgroup = "Wyoming", name = "Wyoming - Residential",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Wyoming") %>%
filter(value_id == "Google_GroceryMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "pink"), legendgroup = "Wyoming", name = "Wyoming - Grocery",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Wyoming") %>%
filter(value_id == "Google_TransitStationsMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "grey"), legendgroup = "Wyoming", name = "Wyoming - Transit Stations",
visible = "legendonly") %>% add_trace(data = filter(googlemobility, name == "Wyoming") %>%
filter(value_id == "Google_WorkplacesMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "orange"), legendgroup = "Wyoming", name = "Wyoming - Workplaces",
visible = "legendonly") %>% layout(title = "Google Mobility Data (02/2020-12/2020)",
xaxis = list(title = "Date"), yaxis = list(title = "Mobility Compared to Baseline",
ticksuffix = "%"), shapes = list(type = "line", line = list(color = "black"),
opacity = 0.5, x0 = "2020-02-15", x1 = "2020-12-06", xref = "x", y0 = 100,
y1 = 100, yref = "y"), margin = list(l = 80, r = 80, b = 75, t = 100, pad = 4))
Movement in nearly all states dropped below baseline levels, except for spikes in residential movement. Interestingly, Hawaii also saw a drop in visits to public parks.
Apple Mobility Data
Apple provides data on the mode of transport in peoples’ movements, i.e. driving, taking public transit, or walking.
Overview
mobility %>% mutate(name = name %>% str_remove("_UnitedStates")) %>% filter(str_detect(value_id,
"Apple")) %>% ggplot(aes(dates, mobility_smoothed/100, color = value_id)) + geom_hline(aes(yintercept = 1),
linetype = "dashed") + geom_line() + scale_y_continuous(labels = scales::percent) +
facet_wrap(vars(name)) + labs(x = "Date", y = "Mobility compared to baseline",
color = "Metric", title = "Apple mobility indices by state")
Interactive View
applemobility <- mobility %>% mutate(name = name %>% str_remove("_UnitedStates")) %>%
filter(str_detect(value_id, "Apple"))
plot_ly(filter(applemobility, value_id == "Apple_DrivingMobility") %>% filter(name ==
"Hawaii"), x = ~dates, y = ~data, type = "scatter", mode = "lines", line = list(color = "lime"),
legendgroup = "Hawaii", name = "Hawaii - Driving") %>% add_trace(data = filter(applemobility,
name == "Hawaii") %>% filter(value_id == "Apple_TransitMobility"), type = "scatter",
mode = "lines", line = list(color = "blue"), legendgroup = "Hawaii", name = "Hawaii - Transit") %>%
add_trace(data = filter(applemobility, name == "Hawaii") %>% filter(value_id ==
"Apple_WalkingMobility"), type = "scatter", mode = "lines", line = list(color = "brown"),
legendgroup = "Hawaii", name = "Hawaii - Walking") %>% add_trace(data = filter(applemobility,
name == "Alabama") %>% filter(value_id == "Apple_DrivingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "lime"), legendgroup = "Alabama",
name = "Alabama - Driving", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Alabama") %>% filter(value_id == "Apple_TransitMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "blue"), legendgroup = "Alabama",
name = "Alabama - Transit", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Alabama") %>% filter(value_id == "Apple_WalkingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "brown"), legendgroup = "Alabama",
name = "Alabama - Walking", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Alaska") %>% filter(value_id == "Apple_DrivingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "lime"), legendgroup = "Alaska",
name = "Alaska - Driving", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Alaska") %>% filter(value_id == "Apple_TransitMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "blue"), legendgroup = "Alaska",
name = "Alaska - Transit", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Alaska") %>% filter(value_id == "Apple_WalkingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "brown"), legendgroup = "Alaska",
name = "Alaska - Walking", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Arizona") %>% filter(value_id == "Apple_DrivingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "lime"), legendgroup = "Arizona",
name = "Arizona - Driving", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Arizona") %>% filter(value_id == "Apple_TransitMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "blue"), legendgroup = "Arizona",
name = "Arizona - Transit", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Arizona") %>% filter(value_id == "Apple_WalkingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "brown"), legendgroup = "Arizona",
name = "Arizona - Walking", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Arkansas") %>% filter(value_id == "Apple_DrivingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "lime"), legendgroup = "Arkansas",
name = "Arkansas - Driving", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Arkansas") %>% filter(value_id == "Apple_TransitMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "blue"), legendgroup = "Arkansas",
name = "Arkansas - Transit", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Arkansas") %>% filter(value_id == "Apple_WalkingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "brown"), legendgroup = "Arkansas",
name = "Arkansas - Walking", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "California") %>% filter(value_id == "Apple_DrivingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "lime"), legendgroup = "California",
name = "California - Driving", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "California") %>% filter(value_id == "Apple_TransitMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "blue"), legendgroup = "California",
name = "California - Transit", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "California") %>% filter(value_id == "Apple_WalkingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "brown"), legendgroup = "California",
name = "California - Walking", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Colorado") %>% filter(value_id == "Apple_DrivingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "lime"), legendgroup = "Colorado",
name = "Colorado - Driving", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Colorado") %>% filter(value_id == "Apple_TransitMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "blue"), legendgroup = "Colorado",
name = "Colorado - Transit", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Colorado") %>% filter(value_id == "Apple_WalkingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "brown"), legendgroup = "Colorado",
name = "Colorado - Walking", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Connecticut") %>% filter(value_id == "Apple_DrivingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "lime"), legendgroup = "Connecticut",
name = "Connecticut - Driving", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Connecticut") %>% filter(value_id == "Apple_TransitMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "blue"), legendgroup = "Connecticut",
name = "Connecticut - Transit", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Connecticut") %>% filter(value_id == "Apple_WalkingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "brown"), legendgroup = "Connecticut",
name = "Connecticut - Walking", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Delaware") %>% filter(value_id == "Apple_DrivingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "lime"), legendgroup = "Delaware",
name = "Delaware - Driving", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Delaware") %>% filter(value_id == "Apple_TransitMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "blue"), legendgroup = "Delaware",
name = "Delaware - Transit", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Delaware") %>% filter(value_id == "Apple_WalkingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "brown"), legendgroup = "Delaware",
name = "Delaware - Walking", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "DistrictofColumbia") %>% filter(value_id == "Apple_DrivingMobility"),
opacity = 0.5, type = "scatter", mode = "lines", line = list(color = "lime"),
legendgroup = "DistrictofColumbia", name = "District of Columbia - Driving",
visible = "legendonly") %>% add_trace(data = filter(applemobility, name == "DistrictofColumbia") %>%
filter(value_id == "Apple_TransitMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "blue"), legendgroup = "DistrictofColumbia",
name = "District of Columbia - Transit", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "DistrictofColumbia") %>% filter(value_id == "Apple_WalkingMobility"),
opacity = 0.5, type = "scatter", mode = "lines", line = list(color = "brown"),
legendgroup = "DistrictofColumbia", name = "District of Columbia - Walking",
visible = "legendonly") %>% add_trace(data = filter(applemobility, name == "Florida") %>%
filter(value_id == "Apple_DrivingMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "lime"), legendgroup = "Florida", name = "Florida - Driving",
visible = "legendonly") %>% add_trace(data = filter(applemobility, name == "Florida") %>%
filter(value_id == "Apple_TransitMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "blue"), legendgroup = "Florida", name = "Florida - Transit",
visible = "legendonly") %>% add_trace(data = filter(applemobility, name == "Florida") %>%
filter(value_id == "Apple_WalkingMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "brown"), legendgroup = "Florida", name = "Florida - Walking",
visible = "legendonly") %>% add_trace(data = filter(applemobility, name == "Georgia") %>%
filter(value_id == "Apple_DrivingMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "lime"), legendgroup = "Georgia", name = "Georgia - Driving",
visible = "legendonly") %>% add_trace(data = filter(applemobility, name == "Georgia") %>%
filter(value_id == "Apple_TransitMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "blue"), legendgroup = "Georgia", name = "Georgia - Transit",
visible = "legendonly") %>% add_trace(data = filter(applemobility, name == "Georgia") %>%
filter(value_id == "Apple_WalkingMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "brown"), legendgroup = "Georgia", name = "Georgia - Walking",
visible = "legendonly") %>% add_trace(data = filter(applemobility, name == "Idaho") %>%
filter(value_id == "Apple_DrivingMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "lime"), legendgroup = "Idaho", name = "Idaho - Driving",
visible = "legendonly") %>% add_trace(data = filter(applemobility, name == "Idaho") %>%
filter(value_id == "Apple_TransitMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "blue"), legendgroup = "Idaho", name = "Idaho - Transit",
visible = "legendonly") %>% add_trace(data = filter(applemobility, name == "Idaho") %>%
filter(value_id == "Apple_WalkingMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "brown"), legendgroup = "Idaho", name = "Idaho - Walking",
visible = "legendonly") %>% add_trace(data = filter(applemobility, name == "Illinois") %>%
filter(value_id == "Apple_DrivingMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "lime"), legendgroup = "Illinois", name = "Illinois - Driving",
visible = "legendonly") %>% add_trace(data = filter(applemobility, name == "Illinois") %>%
filter(value_id == "Apple_TransitMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "blue"), legendgroup = "Illinois", name = "Illinois - Transit",
visible = "legendonly") %>% add_trace(data = filter(applemobility, name == "Illinois") %>%
filter(value_id == "Apple_WalkingMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "brown"), legendgroup = "Illinois", name = "Illinois - Walking",
visible = "legendonly") %>% add_trace(data = filter(applemobility, name == "Indiana") %>%
filter(value_id == "Apple_DrivingMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "lime"), legendgroup = "Indiana", name = "Indiana - Driving",
visible = "legendonly") %>% add_trace(data = filter(applemobility, name == "Indiana") %>%
filter(value_id == "Apple_TransitMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "blue"), legendgroup = "Indiana", name = "Indiana - Transit",
visible = "legendonly") %>% add_trace(data = filter(applemobility, name == "Indiana") %>%
filter(value_id == "Apple_WalkingMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "brown"), legendgroup = "Indiana", name = "Indiana - Walking",
visible = "legendonly") %>% add_trace(data = filter(applemobility, name == "Iowa") %>%
filter(value_id == "Apple_DrivingMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "lime"), legendgroup = "Iowa", name = "Iowa - Driving",
visible = "legendonly") %>% add_trace(data = filter(applemobility, name == "Iowa") %>%
filter(value_id == "Apple_TransitMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "blue"), legendgroup = "Iowa", name = "Iowa - Transit",
visible = "legendonly") %>% add_trace(data = filter(applemobility, name == "Iowa") %>%
filter(value_id == "Apple_WalkingMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "brown"), legendgroup = "Iowa", name = "Iowa - Walking",
visible = "legendonly") %>% add_trace(data = filter(applemobility, name == "Kansas") %>%
filter(value_id == "Apple_DrivingMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "lime"), legendgroup = "Kansas", name = "Kansas - Driving",
visible = "legendonly") %>% add_trace(data = filter(applemobility, name == "Kansas") %>%
filter(value_id == "Apple_TransitMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "blue"), legendgroup = "Kansas", name = "Kansas - Transit",
visible = "legendonly") %>% add_trace(data = filter(applemobility, name == "Kansas") %>%
filter(value_id == "Apple_WalkingMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "brown"), legendgroup = "Kansas", name = "Kansas - Walking",
visible = "legendonly") %>% add_trace(data = filter(applemobility, name == "Kentucky") %>%
filter(value_id == "Apple_DrivingMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "lime"), legendgroup = "Kentucky", name = "Kentucky - Driving",
visible = "legendonly") %>% add_trace(data = filter(applemobility, name == "Kentucky") %>%
filter(value_id == "Apple_TransitMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "blue"), legendgroup = "Kentucky", name = "Kentucky - Transit",
visible = "legendonly") %>% add_trace(data = filter(applemobility, name == "Kentucky") %>%
filter(value_id == "Apple_WalkingMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "brown"), legendgroup = "Kentucky", name = "Kentucky - Walking",
visible = "legendonly") %>% add_trace(data = filter(applemobility, name == "Louisiana") %>%
filter(value_id == "Apple_DrivingMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "lime"), legendgroup = "Louisiana", name = "Louisiana - Driving",
visible = "legendonly") %>% add_trace(data = filter(applemobility, name == "Louisiana") %>%
filter(value_id == "Apple_TransitMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "blue"), legendgroup = "Louisiana", name = "Louisiana - Transit",
visible = "legendonly") %>% add_trace(data = filter(applemobility, name == "Louisiana") %>%
filter(value_id == "Apple_WalkingMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "brown"), legendgroup = "Louisiana", name = "Louisiana - Walking",
visible = "legendonly") %>% add_trace(data = filter(applemobility, name == "Maine") %>%
filter(value_id == "Apple_DrivingMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "lime"), legendgroup = "Maine", name = "Maine - Driving",
visible = "legendonly") %>% add_trace(data = filter(applemobility, name == "Maine") %>%
filter(value_id == "Apple_TransitMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "blue"), legendgroup = "Maine", name = "Maine - Transit",
visible = "legendonly") %>% add_trace(data = filter(applemobility, name == "Maine") %>%
filter(value_id == "Apple_WalkingMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "brown"), legendgroup = "Maine", name = "Maine - Walking",
visible = "legendonly") %>% add_trace(data = filter(applemobility, name == "Maryland") %>%
filter(value_id == "Apple_DrivingMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "lime"), legendgroup = "Maryland", name = "Maryland - Driving",
visible = "legendonly") %>% add_trace(data = filter(applemobility, name == "Maryland") %>%
filter(value_id == "Apple_TransitMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "blue"), legendgroup = "Maryland", name = "Maryland - Transit",
visible = "legendonly") %>% add_trace(data = filter(applemobility, name == "Maryland") %>%
filter(value_id == "Apple_WalkingMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "brown"), legendgroup = "Maryland", name = "Maryland - Walking",
visible = "legendonly") %>% add_trace(data = filter(applemobility, name == "Massachusetts") %>%
filter(value_id == "Apple_DrivingMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "lime"), legendgroup = "Massachusetts", name = "Massachusetts - Driving",
visible = "legendonly") %>% add_trace(data = filter(applemobility, name == "Massachusetts") %>%
filter(value_id == "Apple_TransitMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "blue"), legendgroup = "Massachusetts", name = "Massachusetts - Transit",
visible = "legendonly") %>% add_trace(data = filter(applemobility, name == "Massachusetts") %>%
filter(value_id == "Apple_WalkingMobility"), opacity = 0.5, type = "scatter",
mode = "lines", line = list(color = "brown"), legendgroup = "Massachusetts",
name = "Massachusetts - Walking", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Michigan") %>% filter(value_id == "Apple_DrivingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "lime"), legendgroup = "Michigan",
name = "Michigan - Driving", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Michigan") %>% filter(value_id == "Apple_TransitMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "blue"), legendgroup = "Michigan",
name = "Michigan - Transit", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Michigan") %>% filter(value_id == "Apple_WalkingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "brown"), legendgroup = "Michigan",
name = "Michigan - Walking", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Minnesota") %>% filter(value_id == "Apple_DrivingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "lime"), legendgroup = "Minnesota",
name = "Minnesota - Driving", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Minnesota") %>% filter(value_id == "Apple_TransitMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "blue"), legendgroup = "Minnesota",
name = "Minnesota - Transit", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Minnesota") %>% filter(value_id == "Apple_WalkingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "brown"), legendgroup = "Minnesota",
name = "Minnesota - Walking", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Mississippi") %>% filter(value_id == "Apple_DrivingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "lime"), legendgroup = "Mississippi",
name = "Mississippi - Driving", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Mississippi") %>% filter(value_id == "Apple_TransitMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "blue"), legendgroup = "Mississippi",
name = "Mississippi - Transit", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Mississippi") %>% filter(value_id == "Apple_WalkingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "brown"), legendgroup = "Mississippi",
name = "Mississippi - Walking", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Missouri") %>% filter(value_id == "Apple_DrivingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "lime"), legendgroup = "Missouri",
name = "Missouri - Driving", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Missouri") %>% filter(value_id == "Apple_TransitMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "blue"), legendgroup = "Missouri",
name = "Missouri - Transit", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Missouri") %>% filter(value_id == "Apple_WalkingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "brown"), legendgroup = "Missouri",
name = "Missouri - Walking", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Montana") %>% filter(value_id == "Apple_DrivingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "lime"), legendgroup = "Montana",
name = "Montana - Driving", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Montana") %>% filter(value_id == "Apple_TransitMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "blue"), legendgroup = "Montana",
name = "Montana - Transit", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Montana") %>% filter(value_id == "Apple_WalkingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "brown"), legendgroup = "Montana",
name = "Montana - Walking", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Nebraska") %>% filter(value_id == "Apple_DrivingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "lime"), legendgroup = "Nebraska",
name = "Nebraska - Driving", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Nebraska") %>% filter(value_id == "Apple_TransitMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "blue"), legendgroup = "Nebraska",
name = "Nebraska - Transit", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Nebraska") %>% filter(value_id == "Apple_WalkingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "brown"), legendgroup = "Nebraska",
name = "Nebraska - Walking", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Nevada") %>% filter(value_id == "Apple_DrivingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "lime"), legendgroup = "Nevada",
name = "Nevada - Driving", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Nevada") %>% filter(value_id == "Apple_TransitMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "blue"), legendgroup = "Nevada",
name = "Nevada - Transit", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Nevada") %>% filter(value_id == "Apple_WalkingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "brown"), legendgroup = "Nevada",
name = "Nevada - Walking", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "NewHampshire") %>% filter(value_id == "Apple_DrivingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "lime"), legendgroup = "NewHampshire",
name = "New Hampshire - Driving", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "NewHampshire") %>% filter(value_id == "Apple_TransitMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "blue"), legendgroup = "NewHampshire",
name = "New Hampshire - Transit", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "NewHampshire") %>% filter(value_id == "Apple_WalkingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "brown"), legendgroup = "NewHampshire",
name = "New Hampshire - Walking", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "NewJersey") %>% filter(value_id == "Apple_DrivingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "lime"), legendgroup = "NewJersey",
name = "New Jersey - Driving", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "NewJersey") %>% filter(value_id == "Apple_TransitMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "blue"), legendgroup = "NewJersey",
name = "New Jersey - Transit", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "NewJersey") %>% filter(value_id == "Apple_WalkingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "brown"), legendgroup = "NewJersey",
name = "New Jersey - Walking", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "NewMexico") %>% filter(value_id == "Apple_DrivingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "lime"), legendgroup = "NewMexico",
name = "New Mexico - Driving", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "NewMexico") %>% filter(value_id == "Apple_TransitMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "blue"), legendgroup = "NewMexico",
name = "New Mexico - Transit", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "NewMexico") %>% filter(value_id == "Apple_WalkingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "brown"), legendgroup = "NewMexico",
name = "New Mexico - Walking", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "NewYork") %>% filter(value_id == "Apple_DrivingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "lime"), legendgroup = "NewYork",
name = "New York - Driving", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "NewYork") %>% filter(value_id == "Apple_TransitMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "blue"), legendgroup = "NewYork",
name = "New York - Transit", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "NewYork") %>% filter(value_id == "Apple_WalkingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "brown"), legendgroup = "NewYork",
name = "New York - Walking", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "NorthCarolina") %>% filter(value_id == "Apple_DrivingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "lime"), legendgroup = "NorthCarolina",
name = "North Carolina - Driving", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "NorthCarolina") %>% filter(value_id == "Apple_TransitMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "blue"), legendgroup = "NorthCarolina",
name = "North Carolina - Transit", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "NorthCarolina") %>% filter(value_id == "Apple_WalkingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "brown"), legendgroup = "NorthCarolina",
name = "North Carolina - Walking", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "NorthDakota") %>% filter(value_id == "Apple_DrivingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "lime"), legendgroup = "NorthDakota",
name = "NorthDakota - Driving", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "NorthDakota") %>% filter(value_id == "Apple_TransitMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "blue"), legendgroup = "NorthDakota",
name = "NorthDakota - Transit", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "NorthDakota") %>% filter(value_id == "Apple_WalkingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "brown"), legendgroup = "NorthDakota",
name = "NorthDakota - Walking", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Ohio") %>% filter(value_id == "Apple_DrivingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "lime"), legendgroup = "Ohio",
name = "Ohio - Driving", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Ohio") %>% filter(value_id == "Apple_TransitMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "blue"), legendgroup = "Ohio",
name = "Ohio - Transit", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Ohio") %>% filter(value_id == "Apple_WalkingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "brown"), legendgroup = "Ohio",
name = "Ohio - Walking", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Oklahoma") %>% filter(value_id == "Apple_DrivingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "lime"), legendgroup = "Oklahoma",
name = "Oklahoma - Driving", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Oklahoma") %>% filter(value_id == "Apple_TransitMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "blue"), legendgroup = "Oklahoma",
name = "Oklahoma - Transit", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Oklahoma") %>% filter(value_id == "Apple_WalkingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "brown"), legendgroup = "Oklahoma",
name = "Oklahoma - Walking", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Oregon") %>% filter(value_id == "Apple_DrivingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "lime"), legendgroup = "Oregon",
name = "Oregon - Driving", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Oregon") %>% filter(value_id == "Apple_TransitMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "blue"), legendgroup = "Oregon",
name = "Oregon - Transit", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Oregon") %>% filter(value_id == "Apple_WalkingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "brown"), legendgroup = "Oregon",
name = "Oregon - Walking", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Pennsylvania") %>% filter(value_id == "Apple_DrivingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "lime"), legendgroup = "Pennsylvania",
name = "Pennsylvania - Driving", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Pennsylvania") %>% filter(value_id == "Apple_TransitMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "blue"), legendgroup = "Pennsylvania",
name = "Pennsylvania - Transit", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Pennsylvania") %>% filter(value_id == "Apple_WalkingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "brown"), legendgroup = "Pennsylvania",
name = "Pennsylvania - Walking", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "PuertoRico") %>% filter(value_id == "Apple_DrivingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "lime"), legendgroup = "PuertoRico",
name = "Puerto Rico - Driving", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "PuertoRico") %>% filter(value_id == "Apple_TransitMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "blue"), legendgroup = "PuertoRico",
name = "Puerto Rico - Transit", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "PuertoRico") %>% filter(value_id == "Apple_WalkingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "brown"), legendgroup = "PuertoRico",
name = "Puerto Rico - Walking", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "RhodeIsland") %>% filter(value_id == "Apple_DrivingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "lime"), legendgroup = "RhodeIsland",
name = "Rhode Island - Driving", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "RhodeIsland") %>% filter(value_id == "Apple_TransitMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "blue"), legendgroup = "RhodeIsland",
name = "Rhode Island - Transit", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "RhodeIsland") %>% filter(value_id == "Apple_WalkingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "brown"), legendgroup = "RhodeIsland",
name = "Rhode Island - Walking", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "SouthCarolina") %>% filter(value_id == "Apple_DrivingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "lime"), legendgroup = "SouthCarolina",
name = "South Carolina - Driving", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "SouthCarolina") %>% filter(value_id == "Apple_TransitMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "blue"), legendgroup = "SouthCarolina",
name = "South Carolina - Transit", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "SouthCarolina") %>% filter(value_id == "Apple_WalkingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "brown"), legendgroup = "SouthCarolina",
name = "South Carolina - Walking", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "SouthDakota") %>% filter(value_id == "Apple_DrivingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "lime"), legendgroup = "SouthDakota",
name = "South Dakota - Driving", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "SouthDakota") %>% filter(value_id == "Apple_TransitMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "blue"), legendgroup = "SouthDakota",
name = "South Dakota - Transit", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "SouthDakota") %>% filter(value_id == "Apple_WalkingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "brown"), legendgroup = "SouthDakota",
name = "South Dakota - Walking", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Tennessee") %>% filter(value_id == "Apple_DrivingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "lime"), legendgroup = "Tennessee",
name = "Tennessee - Driving", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Tennessee") %>% filter(value_id == "Apple_TransitMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "blue"), legendgroup = "Tennessee",
name = "Tennessee - Transit", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Tennessee") %>% filter(value_id == "Apple_WalkingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "brown"), legendgroup = "Tennessee",
name = "Tennessee - Walking", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Texas") %>% filter(value_id == "Apple_DrivingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "lime"), legendgroup = "Texas",
name = "Texas - Driving", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Texas") %>% filter(value_id == "Apple_TransitMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "blue"), legendgroup = "Texas",
name = "Texas - Transit", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Texas") %>% filter(value_id == "Apple_WalkingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "brown"), legendgroup = "Texas",
name = "Texas - Walking", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Utah") %>% filter(value_id == "Apple_DrivingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "lime"), legendgroup = "Utah",
name = "Utah - Driving", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Utah") %>% filter(value_id == "Apple_TransitMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "blue"), legendgroup = "Utah",
name = "Utah - Transit", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Utah") %>% filter(value_id == "Apple_WalkingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "brown"), legendgroup = "Utah",
name = "Utah - Walking", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Vermont") %>% filter(value_id == "Apple_DrivingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "lime"), legendgroup = "Vermont",
name = "Vermont - Driving", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Vermont") %>% filter(value_id == "Apple_TransitMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "blue"), legendgroup = "Vermont",
name = "Vermont - Transit", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Vermont") %>% filter(value_id == "Apple_WalkingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "brown"), legendgroup = "Vermont",
name = "Vermont - Walking", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Virginia") %>% filter(value_id == "Apple_DrivingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "lime"), legendgroup = "Virginia",
name = "Virginia - Driving", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Virginia") %>% filter(value_id == "Apple_TransitMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "blue"), legendgroup = "Virginia",
name = "Virginia - Transit", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Virginia") %>% filter(value_id == "Apple_WalkingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "brown"), legendgroup = "Virginia",
name = "Virginia - Walking", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Washington") %>% filter(value_id == "Apple_DrivingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "lime"), legendgroup = "Washington",
name = "Washington - Driving", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Washington") %>% filter(value_id == "Apple_TransitMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "blue"), legendgroup = "Washington",
name = "Washington - Transit", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Washington") %>% filter(value_id == "Apple_WalkingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "brown"), legendgroup = "Washington",
name = "Washington - Walking", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "WestVirginia") %>% filter(value_id == "Apple_DrivingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "lime"), legendgroup = "WestVirginia",
name = "West Virginia - Driving", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "WestVirginia") %>% filter(value_id == "Apple_TransitMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "blue"), legendgroup = "WestVirginia",
name = "West Virginia - Transit", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "WestVirginia") %>% filter(value_id == "Apple_WalkingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "brown"), legendgroup = "WestVirginia",
name = "West Virginia - Walking", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Wisconsin") %>% filter(value_id == "Apple_DrivingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "lime"), legendgroup = "Wisconsin",
name = "Wisconsin - Driving", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Wisconsin") %>% filter(value_id == "Apple_TransitMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "blue"), legendgroup = "Wisconsin",
name = "Wisconsin - Transit", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Wisconsin") %>% filter(value_id == "Apple_WalkingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "brown"), legendgroup = "Wisconsin",
name = "Wisconsin - Walking", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Wyoming") %>% filter(value_id == "Apple_DrivingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "lime"), legendgroup = "Wyoming",
name = "Wyoming - Driving", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Wyoming") %>% filter(value_id == "Apple_TransitMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "blue"), legendgroup = "Wyoming",
name = "Wyoming - Transit", visible = "legendonly") %>% add_trace(data = filter(applemobility,
name == "Wyoming") %>% filter(value_id == "Apple_WalkingMobility"), opacity = 0.5,
type = "scatter", mode = "lines", line = list(color = "brown"), legendgroup = "Wyoming",
name = "Wyoming - Walking", visible = "legendonly") %>% layout(title = "Apple Mobility Data (02/2020-12/2020)",
xaxis = list(title = "Date"), yaxis = list(title = "Mobility Compared to Baseline",
ticksuffix = "%"), shapes = list(type = "line", line = list(color = "black"),
opacity = 0.5, x0 = "2020-02-15", x1 = "2020-12-06", xref = "x", y0 = 100,
y1 = 100, yref = "y"), margin = list(l = 80, r = 80, b = 75, t = 100, pad = 4))
Hawaii sees a significant and consistent drop below the baseline for all modes of transport. Other states, however, only saw reductions in the use of public transit but significant, over the baseline increases in driving and walking.
PlaceIQ (Device Exposures)
The Device Exposure Index (DEX), released by UC Berkeley and based on smartphone data provided by PlaceIQ, provides the following at the state level:
For a smartphone residing in a given state, how many distinct devices also visited any of the commercial venues that this device visited today? The state-level DEX reports the state-level average of this number across all devices residing in the state that day. The DEX values are necessarily only a fraction of the number of distinct individuals that also visited any of the commercial venues visited by a device, since only a fraction of individuals, venues, and visits are in the device sample.
The adjusted index is used here to counteract the sample bias caused by shelter-in-place.
exposure <- movement %>% filter(value_id == "PlaceIQ_DeviceExposure_Adjusted") %>%
group_by(name, value_id) %>% arrange(dates) %>% mutate(exposure_smoothed = rollmean(data,
7, align = "right", fill = NA)) %>% ungroup() %>% mutate(name = name %>% str_remove("_UnitedStates"))
plot_ly(filter(exposure, name == "Hawaii"), x = ~dates, y = ~data, name = "Hawaii",
type = "scatter", mode = "lines") %>% add_trace(data = filter(exposure, name ==
"Alabama"), x = ~dates, y = ~data, opacity = 0.3, name = "Alabama", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(exposure,
name == "Alaska"), x = ~dates, y = ~data, opacity = 0.3, name = "Alaska", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(exposure,
name == "Arizona"), x = ~dates, y = ~data, opacity = 0.3, name = "Arizona", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(exposure,
name == "Arkansas"), x = ~dates, y = ~data, opacity = 0.3, name = "Arkansas",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(exposure,
name == "California"), x = ~dates, y = ~data, opacity = 0.3, name = "California",
type = "scatter", mode = "lines") %>% add_trace(data = filter(exposure, name ==
"Colorado"), x = ~dates, y = ~data, opacity = 0.3, name = "Colorado", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(exposure,
name == "Connecticut"), x = ~dates, y = ~data, opacity = 0.3, name = "Connecticut",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(exposure,
name == "Delaware"), x = ~dates, y = ~data, opacity = 0.3, name = "Delaware",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(exposure,
name == "DistrictofColumbia"), x = ~dates, y = ~data, opacity = 0.3, name = "District of Columbia",
type = "scatter", mode = "lines") %>% add_trace(data = filter(exposure, name ==
"Florida"), x = ~dates, y = ~data, opacity = 0.3, name = "Florida", type = "scatter",
mode = "lines") %>% add_trace(data = filter(exposure, name == "Georgia"), x = ~dates,
y = ~data, opacity = 0.3, name = "Georgia", type = "scatter", mode = "lines",
visible = "legendonly") %>% add_trace(data = filter(exposure, name == "Idaho"),
x = ~dates, y = ~data, opacity = 0.3, name = "Idaho", type = "scatter", mode = "lines",
visible = "legendonly") %>% add_trace(data = filter(exposure, name == "Illinois"),
x = ~dates, y = ~data, opacity = 0.3, name = "Illinois", type = "scatter", mode = "lines",
visible = "legendonly") %>% add_trace(data = filter(exposure, name == "Indiana"),
x = ~dates, y = ~data, opacity = 0.3, name = "Indiana", type = "scatter", mode = "lines",
visible = "legendonly") %>% add_trace(data = filter(exposure, name == "Iowa"),
x = ~dates, y = ~data, opacity = 0.3, name = "Iowa", type = "scatter", mode = "lines",
visible = "legendonly") %>% add_trace(data = filter(exposure, name == "Kansas"),
x = ~dates, y = ~data, opacity = 0.3, name = "Kansas", type = "scatter", mode = "lines",
visible = "legendonly") %>% add_trace(data = filter(exposure, name == "Kentucky"),
x = ~dates, y = ~data, opacity = 0.3, name = "Kentucky", type = "scatter", mode = "lines",
visible = "legendonly") %>% add_trace(data = filter(exposure, name == "Louisiana"),
x = ~dates, y = ~data, opacity = 0.3, name = "Louisiana", type = "scatter", mode = "lines",
visible = "legendonly") %>% add_trace(data = filter(exposure, name == "Maine"),
x = ~dates, y = ~data, opacity = 0.3, name = "Maine", type = "scatter", mode = "lines",
visible = "legendonly") %>% add_trace(data = filter(exposure, name == "Maryland"),
x = ~dates, y = ~data, opacity = 0.3, name = "Maryland", type = "scatter", mode = "lines",
visible = "legendonly") %>% add_trace(data = filter(exposure, name == "Massachusetts"),
x = ~dates, y = ~data, opacity = 0.3, name = "Massachusetts", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(exposure,
name == "Michigan"), x = ~dates, y = ~data, opacity = 0.3, name = "Michigan",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(exposure,
name == "Minnesota"), x = ~dates, y = ~data, opacity = 0.3, name = "Minnesota",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(exposure,
name == "Mississippi"), x = ~dates, y = ~data, opacity = 0.3, name = "Mississippi",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(exposure,
name == "Missouri"), x = ~dates, y = ~data, opacity = 0.3, name = "Missouri",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(exposure,
name == "Montana"), x = ~dates, y = ~data, opacity = 0.3, name = "Montana", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(exposure,
name == "Nebraska"), x = ~dates, y = ~data, opacity = 0.3, name = "Nebraska",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(exposure,
name == "Nevada"), x = ~dates, y = ~data, opacity = 0.3, name = "Nevada", type = "scatter",
mode = "lines") %>% add_trace(data = filter(exposure, name == "NewHampshire"),
x = ~dates, y = ~data, opacity = 0.3, name = "New Hampshire", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(exposure,
name == "NewJersey"), x = ~dates, y = ~data, opacity = 0.3, name = "New Jersey",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(exposure,
name == "NewMexico"), x = ~dates, y = ~data, opacity = 0.3, name = "New Mexico",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(exposure,
name == "NewYork"), x = ~dates, y = ~data, opacity = 0.3, name = "New York",
type = "scatter", mode = "lines") %>% add_trace(data = filter(exposure, name ==
"NorthCarolina"), x = ~dates, y = ~data, opacity = 0.3, name = "North Carolina",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(exposure,
name == "NorthDakota"), x = ~dates, y = ~data, opacity = 0.3, name = "North Dakota",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(exposure,
name == "Ohio"), x = ~dates, y = ~data, opacity = 0.3, name = "Ohio", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(exposure,
name == "Oklahoma"), x = ~dates, y = ~data, opacity = 0.3, name = "Oklahoma",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(exposure,
name == "Oregon"), x = ~dates, y = ~data, opacity = 0.3, name = "Oregon", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(exposure,
name == "Pennsylvania"), x = ~dates, y = ~data, opacity = 0.3, name = "Pennsylvania",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(exposure,
name == "PuertoRico"), x = ~dates, y = ~data, opacity = 0.3, name = "Puerto Rico",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(exposure,
name == "RhodeIsland"), x = ~dates, y = ~data, opacity = 0.3, name = "Rhode Island",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(exposure,
name == "SouthCarolina"), x = ~dates, y = ~data, opacity = 0.3, name = "South Carolina",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(exposure,
name == "SouthDakota"), x = ~dates, y = ~data, opacity = 0.3, name = "South Dakota",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(exposure,
name == "Tennessee"), x = ~dates, y = ~data, opacity = 0.3, name = "Tennessee",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(exposure,
name == "Texas"), x = ~dates, y = ~data, opacity = 0.3, name = "Texas", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(exposure,
name == "Utah"), x = ~dates, y = ~data, opacity = 0.3, name = "Utah", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(exposure,
name == "Vermont"), x = ~dates, y = ~data, opacity = 0.3, name = "Vermont", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(exposure,
name == "Virginia"), x = ~dates, y = ~data, opacity = 0.3, name = "Virginia",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(exposure,
name == "Washington"), x = ~dates, y = ~data, opacity = 0.3, name = "Washington",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(exposure,
name == "WestVirginia"), x = ~dates, y = ~data, opacity = 0.3, name = "West Virginia",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(exposure,
name == "Wisconsin"), x = ~dates, y = ~data, opacity = 0.3, name = "Wisconsin",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(exposure,
name == "Wyoming"), x = ~dates, y = ~data, opacity = 0.3, name = "Wyoming", type = "scatter",
mode = "lines") %>% layout(title = "Device Exposure Index, Adjusted (02/2020-12/2020)",
xaxis = list(title = "Date", titlefont = f1, showticklabels = TRUE, tickfont = f2,
exponentformat = "E"), yaxis = list(title = "Average Number of Distinct Devices Exposed",
titlefont = f1, showticklabels = TRUE, tickfont = f2), margin = list(l = 80,
r = 80, b = 100, t = 100, pad = 4))
Hawaii sees comparable and persistent drops in device exposures compared to other states. However, device exposures in Hawaii are not especially low compared to other states. An interesting observation for all states is the consistent pattern of elevated device exposures during the weekends and holidays.
Economic Data
Now, we want to take a look at key economic variables related to real estate and urban economics. Namely, data from the US Bureau of Economic Analysis about the construction and real estate industries.
bea_stats <- evalmetrics(
"outbreaklocation",
list(
spec = list(
ids = states_list,
expressions = list(
"BEA_NominalGDP_Construction_Dollars", #Quarterly data to 2019
"BEA_NominalGDP_RealEstate_Dollars", #Annual data to 2019
"BEA_CompensationOfEmployees_Construction_Dollars", #2020 quarterly Data
"BEA_Employment_Construction_Jobs", #Annual data to 2018
"BEA_CompensationOfEmployees_RealEstate_Dollars", #Annual data to 2019
"BEA_Employment_RealEstate_Jobs" #Annual data to 2018
),
start = "2010-01-01",
end = today,
interval = "MONTH"
)
),
get_all = TRUE
)
Construction GDP (Nominal)
The provided definition of construction is as follows:
The term “Construction” is used in both the SIC system and in NAICS, but it does not have the same definition in both systems. SIC definition:This SIC division includes establishments primarily engaged in construction. The term construction includes new work, additions, alterations, reconstruction, installations, and repairs. Construction activities are generally administered or managed from a relatively fixed place of business, but the actual construction work is performed at one or more different sites. If a company has more than one relatively fixed place of business from which it undertakes or manages construction activities and for which separate data on the number of employees, payroll, receipts, and other establishment-type records are maintained, each such place of business is considered a separate construction establishment. Three broad types of construction activity are covered: (1) building construction by general contractors or by operative builders; (2) heavy construction other than building by general contractors and special trade contractors; and (3) construction activity by other special trade contractors. NAICS definition:The Construction (NAICS) sector comprises establishments primarily engaged in the construction of buildings or engineering projects (e.g., highways an utility systems). Establishments primarily engaged in the preparation of sites for new construction and establishments primarily engaged in subdividing land for sale as building sites also are included in this sector. Construction work done may include new work, additions, alterations, or maintenance and repairs. Activities of these establishments generally are managed at a fixed place of business, but they usually perform construction activities at multiple project sites. Production responsibilities in this sector are usually specified in (1) contracts with the owners of construction projects (prime contracts) or (2) contracts with other construction establishments (subcontracts).
bea_constructiongdp <- bea_stats %>% mutate(name = name %>% str_remove("_UnitedStates")) %>%
filter(value_id %in% c("BEA_NominalGDP_Construction_Dollars"), missing == 0) %>%
select(name, dates, data)
plot_ly(filter(bea_constructiongdp, name == "Hawaii"), x = ~dates, y = ~data, name = "Hawaii",
type = "scatter", mode = "lines") %>% add_trace(data = filter(bea_constructiongdp,
name == "Alabama"), x = ~dates, y = ~data, opacity = 0.3, name = "Alabama", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructiongdp,
name == "Alaska"), x = ~dates, y = ~data, opacity = 0.3, name = "Alaska", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructiongdp,
name == "Arizona"), x = ~dates, y = ~data, opacity = 0.3, name = "Arizona", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructiongdp,
name == "Arkansas"), x = ~dates, y = ~data, opacity = 0.3, name = "Arkansas",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructiongdp,
name == "California"), x = ~dates, y = ~data, opacity = 0.3, name = "California",
type = "scatter", mode = "lines") %>% add_trace(data = filter(bea_constructiongdp,
name == "Colorado"), x = ~dates, y = ~data, opacity = 0.3, name = "Colorado",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructiongdp,
name == "Connecticut"), x = ~dates, y = ~data, opacity = 0.3, name = "Connecticut",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructiongdp,
name == "Delaware"), x = ~dates, y = ~data, opacity = 0.3, name = "Delaware",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructiongdp,
name == "DistrictofColumbia"), x = ~dates, y = ~data, opacity = 0.3, name = "District of Columbia",
type = "scatter", mode = "lines") %>% add_trace(data = filter(bea_constructiongdp,
name == "Florida"), x = ~dates, y = ~data, opacity = 0.3, name = "Florida", type = "scatter",
mode = "lines") %>% add_trace(data = filter(bea_constructiongdp, name == "Georgia"),
x = ~dates, y = ~data, opacity = 0.3, name = "Georgia", type = "scatter", mode = "lines",
visible = "legendonly") %>% add_trace(data = filter(bea_constructiongdp, name ==
"Idaho"), x = ~dates, y = ~data, opacity = 0.3, name = "Idaho", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructiongdp,
name == "Illinois"), x = ~dates, y = ~data, opacity = 0.3, name = "Illinois",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructiongdp,
name == "Indiana"), x = ~dates, y = ~data, opacity = 0.3, name = "Indiana", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructiongdp,
name == "Iowa"), x = ~dates, y = ~data, opacity = 0.3, name = "Iowa", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructiongdp,
name == "Kansas"), x = ~dates, y = ~data, opacity = 0.3, name = "Kansas", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructiongdp,
name == "Kentucky"), x = ~dates, y = ~data, opacity = 0.3, name = "Kentucky",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructiongdp,
name == "Louisiana"), x = ~dates, y = ~data, opacity = 0.3, name = "Louisiana",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructiongdp,
name == "Maine"), x = ~dates, y = ~data, opacity = 0.3, name = "Maine", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructiongdp,
name == "Maryland"), x = ~dates, y = ~data, opacity = 0.3, name = "Maryland",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructiongdp,
name == "Massachusetts"), x = ~dates, y = ~data, opacity = 0.3, name = "Massachusetts",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructiongdp,
name == "Michigan"), x = ~dates, y = ~data, opacity = 0.3, name = "Michigan",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructiongdp,
name == "Minnesota"), x = ~dates, y = ~data, opacity = 0.3, name = "Minnesota",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructiongdp,
name == "Mississippi"), x = ~dates, y = ~data, opacity = 0.3, name = "Mississippi",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructiongdp,
name == "Missouri"), x = ~dates, y = ~data, opacity = 0.3, name = "Missouri",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructiongdp,
name == "Montana"), x = ~dates, y = ~data, opacity = 0.3, name = "Montana", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructiongdp,
name == "Nebraska"), x = ~dates, y = ~data, opacity = 0.3, name = "Nebraska",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructiongdp,
name == "Nevada"), x = ~dates, y = ~data, opacity = 0.3, name = "Nevada", type = "scatter",
mode = "lines") %>% add_trace(data = filter(bea_constructiongdp, name == "NewHampshire"),
x = ~dates, y = ~data, opacity = 0.3, name = "New Hampshire", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructiongdp,
name == "NewJersey"), x = ~dates, y = ~data, opacity = 0.3, name = "New Jersey",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructiongdp,
name == "NewMexico"), x = ~dates, y = ~data, opacity = 0.3, name = "New Mexico",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructiongdp,
name == "NewYork"), x = ~dates, y = ~data, opacity = 0.3, name = "New York",
type = "scatter", mode = "lines") %>% add_trace(data = filter(bea_constructiongdp,
name == "NorthCarolina"), x = ~dates, y = ~data, opacity = 0.3, name = "North Carolina",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructiongdp,
name == "NorthDakota"), x = ~dates, y = ~data, opacity = 0.3, name = "North Dakota",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructiongdp,
name == "Ohio"), x = ~dates, y = ~data, opacity = 0.3, name = "Ohio", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructiongdp,
name == "Oklahoma"), x = ~dates, y = ~data, opacity = 0.3, name = "Oklahoma",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructiongdp,
name == "Oregon"), x = ~dates, y = ~data, opacity = 0.3, name = "Oregon", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructiongdp,
name == "Pennsylvania"), x = ~dates, y = ~data, opacity = 0.3, name = "Pennsylvania",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructiongdp,
name == "PuertoRico"), x = ~dates, y = ~data, opacity = 0.3, name = "Puerto Rico",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructiongdp,
name == "RhodeIsland"), x = ~dates, y = ~data, opacity = 0.3, name = "Rhode Island",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructiongdp,
name == "SouthCarolina"), x = ~dates, y = ~data, opacity = 0.3, name = "South Carolina",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructiongdp,
name == "SouthDakota"), x = ~dates, y = ~data, opacity = 0.3, name = "South Dakota",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructiongdp,
name == "Tennessee"), x = ~dates, y = ~data, opacity = 0.3, name = "Tennessee",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructiongdp,
name == "Texas"), x = ~dates, y = ~data, opacity = 0.3, name = "Texas", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructiongdp,
name == "Utah"), x = ~dates, y = ~data, opacity = 0.3, name = "Utah", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructiongdp,
name == "Vermont"), x = ~dates, y = ~data, opacity = 0.3, name = "Vermont", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructiongdp,
name == "Virginia"), x = ~dates, y = ~data, opacity = 0.3, name = "Virginia",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructiongdp,
name == "Washington"), x = ~dates, y = ~data, opacity = 0.3, name = "Washington",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructiongdp,
name == "WestVirginia"), x = ~dates, y = ~data, opacity = 0.3, name = "West Virginia",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructiongdp,
name == "Wisconsin"), x = ~dates, y = ~data, opacity = 0.3, name = "Wisconsin",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructiongdp,
name == "Wyoming"), x = ~dates, y = ~data, opacity = 0.3, name = "Wyoming", type = "scatter",
mode = "lines") %>% layout(title = "Nominal GDP of States' Construction Industries, in Dollars (2010-2019)",
xaxis = list(title = "Quarter", titlefont = f1, showticklabels = TRUE, tickfont = f2,
exponentformat = "E"), yaxis = list(title = "USD", titlefont = f1, showticklabels = TRUE,
tickfont = f2), margin = list(l = 80, r = 80, b = 100, t = 100, pad = 4))
While this is illustrative of the level of aggregate construction activity in each state, it is not especially meaningful when comparing between states with vastly different populations (e.g., California and Hawaii).
Construction GDP per Capita
Dividing the nominal construction GDP by the state population provides a measure of construction activity that controls for population, and is thereby more comparable between the states.
census <- census %>% mutate(year = year(dates))
bea_constructiongdp <- bea_constructiongdp %>% mutate(year = year(dates))
bea_constructionpercapita <- bea_constructiongdp %>% full_join(mutate(census, name = name %>%
str_remove("_UnitedStates")) %>% dplyr::select("name", "data", "year"), by = c(name = "name",
year = "year")) %>% mutate(gdppercapita = data.x/data.y) %>% mutate(name = name %>%
str_remove("_UnitedStates"))
plot_ly(filter(bea_constructionpercapita, name == "Hawaii"), x = ~dates, y = ~gdppercapita,
name = "Hawaii", type = "scatter", mode = "lines") %>% add_trace(data = filter(bea_constructionpercapita,
name == "Alabama"), x = ~dates, y = ~gdppercapita, opacity = 0.3, name = "Alabama",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructionpercapita,
name == "Alaska"), x = ~dates, y = ~gdppercapita, opacity = 0.3, name = "Alaska",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructionpercapita,
name == "Arizona"), x = ~dates, y = ~gdppercapita, opacity = 0.3, name = "Arizona",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructionpercapita,
name == "Arkansas"), x = ~dates, y = ~gdppercapita, opacity = 0.3, name = "Arkansas",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructionpercapita,
name == "California"), x = ~dates, y = ~gdppercapita, opacity = 0.3, name = "California",
type = "scatter", mode = "lines") %>% add_trace(data = filter(bea_constructionpercapita,
name == "Colorado"), x = ~dates, y = ~gdppercapita, opacity = 0.3, name = "Colorado",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructionpercapita,
name == "Connecticut"), x = ~dates, y = ~gdppercapita, opacity = 0.3, name = "Connecticut",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructionpercapita,
name == "Delaware"), x = ~dates, y = ~gdppercapita, opacity = 0.3, name = "Delaware",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructionpercapita,
name == "DistrictofColumbia"), x = ~dates, y = ~gdppercapita, opacity = 0.3,
name = "District of Columbia", type = "scatter", mode = "lines") %>% add_trace(data = filter(bea_constructionpercapita,
name == "Florida"), x = ~dates, y = ~gdppercapita, opacity = 0.3, name = "Florida",
type = "scatter", mode = "lines") %>% add_trace(data = filter(bea_constructionpercapita,
name == "Georgia"), x = ~dates, y = ~gdppercapita, opacity = 0.3, name = "Georgia",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructionpercapita,
name == "Idaho"), x = ~dates, y = ~gdppercapita, opacity = 0.3, name = "Idaho",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructionpercapita,
name == "Illinois"), x = ~dates, y = ~gdppercapita, opacity = 0.3, name = "Illinois",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructionpercapita,
name == "Indiana"), x = ~dates, y = ~gdppercapita, opacity = 0.3, name = "Indiana",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructionpercapita,
name == "Iowa"), x = ~dates, y = ~gdppercapita, opacity = 0.3, name = "Iowa",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructionpercapita,
name == "Kansas"), x = ~dates, y = ~gdppercapita, opacity = 0.3, name = "Kansas",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructionpercapita,
name == "Kentucky"), x = ~dates, y = ~gdppercapita, opacity = 0.3, name = "Kentucky",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructionpercapita,
name == "Louisiana"), x = ~dates, y = ~gdppercapita, opacity = 0.3, name = "Louisiana",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructionpercapita,
name == "Maine"), x = ~dates, y = ~gdppercapita, opacity = 0.3, name = "Maine",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructionpercapita,
name == "Maryland"), x = ~dates, y = ~gdppercapita, opacity = 0.3, name = "Maryland",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructionpercapita,
name == "Massachusetts"), x = ~dates, y = ~gdppercapita, opacity = 0.3, name = "Massachusetts",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructionpercapita,
name == "Michigan"), x = ~dates, y = ~gdppercapita, opacity = 0.3, name = "Michigan",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructionpercapita,
name == "Minnesota"), x = ~dates, y = ~gdppercapita, opacity = 0.3, name = "Minnesota",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructionpercapita,
name == "Mississippi"), x = ~dates, y = ~gdppercapita, opacity = 0.3, name = "Mississippi",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructionpercapita,
name == "Missouri"), x = ~dates, y = ~gdppercapita, opacity = 0.3, name = "Missouri",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructionpercapita,
name == "Montana"), x = ~dates, y = ~gdppercapita, opacity = 0.3, name = "Montana",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructionpercapita,
name == "Nebraska"), x = ~dates, y = ~gdppercapita, opacity = 0.3, name = "Nebraska",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructionpercapita,
name == "Nevada"), x = ~dates, y = ~gdppercapita, opacity = 0.3, name = "Nevada",
type = "scatter", mode = "lines") %>% add_trace(data = filter(bea_constructionpercapita,
name == "NewHampshire"), x = ~dates, y = ~gdppercapita, opacity = 0.3, name = "New Hampshire",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructionpercapita,
name == "NewJersey"), x = ~dates, y = ~gdppercapita, opacity = 0.3, name = "New Jersey",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructionpercapita,
name == "NewMexico"), x = ~dates, y = ~gdppercapita, opacity = 0.3, name = "New Mexico",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructionpercapita,
name == "NewYork"), x = ~dates, y = ~gdppercapita, opacity = 0.3, name = "New York",
type = "scatter", mode = "lines") %>% add_trace(data = filter(bea_constructionpercapita,
name == "NorthCarolina"), x = ~dates, y = ~gdppercapita, opacity = 0.3, name = "North Carolina",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructionpercapita,
name == "NorthDakota"), x = ~dates, y = ~gdppercapita, opacity = 0.3, name = "North Dakota",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructionpercapita,
name == "Ohio"), x = ~dates, y = ~gdppercapita, opacity = 0.3, name = "Ohio",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructionpercapita,
name == "Oklahoma"), x = ~dates, y = ~gdppercapita, opacity = 0.3, name = "Oklahoma",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructionpercapita,
name == "Oregon"), x = ~dates, y = ~gdppercapita, opacity = 0.3, name = "Oregon",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructionpercapita,
name == "Pennsylvania"), x = ~dates, y = ~gdppercapita, opacity = 0.3, name = "Pennsylvania",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructionpercapita,
name == "PuertoRico"), x = ~dates, y = ~gdppercapita, opacity = 0.3, name = "Puerto Rico",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructionpercapita,
name == "RhodeIsland"), x = ~dates, y = ~gdppercapita, opacity = 0.3, name = "Rhode Island",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructionpercapita,
name == "SouthCarolina"), x = ~dates, y = ~gdppercapita, opacity = 0.3, name = "South Carolina",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructionpercapita,
name == "SouthDakota"), x = ~dates, y = ~gdppercapita, opacity = 0.3, name = "South Dakota",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructionpercapita,
name == "Tennessee"), x = ~dates, y = ~gdppercapita, opacity = 0.3, name = "Tennessee",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructionpercapita,
name == "Texas"), x = ~dates, y = ~gdppercapita, opacity = 0.3, name = "Texas",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructionpercapita,
name == "Utah"), x = ~dates, y = ~gdppercapita, opacity = 0.3, name = "Utah",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructionpercapita,
name == "Vermont"), x = ~dates, y = ~gdppercapita, opacity = 0.3, name = "Vermont",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructionpercapita,
name == "Virginia"), x = ~dates, y = ~gdppercapita, opacity = 0.3, name = "Virginia",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructionpercapita,
name == "Washington"), x = ~dates, y = ~gdppercapita, opacity = 0.3, name = "Washington",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructionpercapita,
name == "WestVirginia"), x = ~dates, y = ~gdppercapita, opacity = 0.3, name = "West Virginia",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructionpercapita,
name == "Wisconsin"), x = ~dates, y = ~gdppercapita, opacity = 0.3, name = "Wisconsin",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_constructionpercapita,
name == "Wyoming"), x = ~dates, y = ~gdppercapita, opacity = 0.3, name = "Wyoming",
type = "scatter", mode = "lines") %>% layout(title = "Nominal GDP of States' Construction Industries per Capita, in Dollars (2010-2019)",
xaxis = list(title = "Quarter", titlefont = f1, showticklabels = TRUE, tickfont = f2,
exponentformat = "E"), yaxis = list(title = "USD", titlefont = f1, showticklabels = TRUE,
tickfont = f2), margin = list(l = 80, r = 80, b = 100, t = 100, pad = 4))
We see that Hawaii has one of the highest levels of construction activity per capita in the country.
Compensation in Construction
We would also like to see how the compensation of construction workers have evolved over time.
The BEA conceives “Compensation of Employees” as:
Compensation measures the total income—both wages and salaries and supplements to wages and salaries—earned by employees in return for contributing to production during an accounting period. It is the largest component of gross domestic income (GDI), of national income, and of personal income in the U.S. national income and product accounts (NIP As). Compensation estimates are an integral part of the NIP As, a set of accounts that provides a logical and consistent framework for presenting statistics on U.S. economic activity.
Average compensation is calculated as:
\(\frac{\text{Total Compensation}_t}{\text{Total Number of Jobs}_t}\) for time period t.
bea_constructioncomp <- bea_stats %>% mutate(name = name %>% str_remove("_UnitedStates")) %>%
filter(value_id %in% c("BEA_CompensationOfEmployees_Construction_Dollars"), missing ==
0) %>% select(name, dates, data) %>% mutate(year = year(dates))
bea_constructionjobs <- bea_stats %>% mutate(name = name %>% str_remove("_UnitedStates")) %>%
filter(value_id %in% c("BEA_Employment_Construction_Jobs"), missing == 0) %>%
select(name, dates, data) %>% mutate(year = year(dates))
bea_avgconstructioncomp <- bea_constructioncomp %>% full_join(mutate(bea_constructionjobs,
name = name %>% str_remove("_UnitedStates")) %>% dplyr::select("name", "data",
"year"), by = c(name = "name", year = "year")) %>% mutate(avgcomp = data.x/data.y) %>%
mutate(name = name %>% str_remove("_UnitedStates"))
plot_ly(filter(bea_avgconstructioncomp, name == "Hawaii"), x = ~dates, y = ~avgcomp,
name = "Hawaii", type = "scatter", mode = "lines") %>% add_trace(data = filter(bea_avgconstructioncomp,
name == "Alabama"), x = ~dates, y = ~avgcomp, opacity = 0.3, name = "Alabama",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgconstructioncomp,
name == "Alaska"), x = ~dates, y = ~avgcomp, opacity = 0.3, name = "Alaska",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgconstructioncomp,
name == "Arizona"), x = ~dates, y = ~avgcomp, opacity = 0.3, name = "Arizona",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgconstructioncomp,
name == "Arkansas"), x = ~dates, y = ~avgcomp, opacity = 0.3, name = "Arkansas",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgconstructioncomp,
name == "California"), x = ~dates, y = ~avgcomp, opacity = 0.3, name = "California",
type = "scatter", mode = "lines") %>% add_trace(data = filter(bea_avgconstructioncomp,
name == "Colorado"), x = ~dates, y = ~avgcomp, opacity = 0.3, name = "Colorado",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgconstructioncomp,
name == "Connecticut"), x = ~dates, y = ~avgcomp, opacity = 0.3, name = "Connecticut",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgconstructioncomp,
name == "Delaware"), x = ~dates, y = ~avgcomp, opacity = 0.3, name = "Delaware",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgconstructioncomp,
name == "DistrictofColumbia"), x = ~dates, y = ~avgcomp, opacity = 0.3, name = "District of Columbia",
type = "scatter", mode = "lines") %>% add_trace(data = filter(bea_avgconstructioncomp,
name == "Florida"), x = ~dates, y = ~avgcomp, opacity = 0.3, name = "Florida",
type = "scatter", mode = "lines") %>% add_trace(data = filter(bea_avgconstructioncomp,
name == "Georgia"), x = ~dates, y = ~avgcomp, opacity = 0.3, name = "Georgia",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgconstructioncomp,
name == "Idaho"), x = ~dates, y = ~avgcomp, opacity = 0.3, name = "Idaho", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgconstructioncomp,
name == "Illinois"), x = ~dates, y = ~avgcomp, opacity = 0.3, name = "Illinois",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgconstructioncomp,
name == "Indiana"), x = ~dates, y = ~avgcomp, opacity = 0.3, name = "Indiana",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgconstructioncomp,
name == "Iowa"), x = ~dates, y = ~avgcomp, opacity = 0.3, name = "Iowa", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgconstructioncomp,
name == "Kansas"), x = ~dates, y = ~avgcomp, opacity = 0.3, name = "Kansas",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgconstructioncomp,
name == "Kentucky"), x = ~dates, y = ~avgcomp, opacity = 0.3, name = "Kentucky",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgconstructioncomp,
name == "Louisiana"), x = ~dates, y = ~avgcomp, opacity = 0.3, name = "Louisiana",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgconstructioncomp,
name == "Maine"), x = ~dates, y = ~avgcomp, opacity = 0.3, name = "Maine", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgconstructioncomp,
name == "Maryland"), x = ~dates, y = ~avgcomp, opacity = 0.3, name = "Maryland",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgconstructioncomp,
name == "Massachusetts"), x = ~dates, y = ~avgcomp, opacity = 0.3, name = "Massachusetts",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgconstructioncomp,
name == "Michigan"), x = ~dates, y = ~avgcomp, opacity = 0.3, name = "Michigan",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgconstructioncomp,
name == "Minnesota"), x = ~dates, y = ~avgcomp, opacity = 0.3, name = "Minnesota",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgconstructioncomp,
name == "Mississippi"), x = ~dates, y = ~avgcomp, opacity = 0.3, name = "Mississippi",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgconstructioncomp,
name == "Missouri"), x = ~dates, y = ~avgcomp, opacity = 0.3, name = "Missouri",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgconstructioncomp,
name == "Montana"), x = ~dates, y = ~avgcomp, opacity = 0.3, name = "Montana",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgconstructioncomp,
name == "Nebraska"), x = ~dates, y = ~avgcomp, opacity = 0.3, name = "Nebraska",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgconstructioncomp,
name == "Nevada"), x = ~dates, y = ~avgcomp, opacity = 0.3, name = "Nevada",
type = "scatter", mode = "lines") %>% add_trace(data = filter(bea_avgconstructioncomp,
name == "NewHampshire"), x = ~dates, y = ~avgcomp, opacity = 0.3, name = "New Hampshire",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgconstructioncomp,
name == "NewJersey"), x = ~dates, y = ~avgcomp, opacity = 0.3, name = "New Jersey",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgconstructioncomp,
name == "NewMexico"), x = ~dates, y = ~avgcomp, opacity = 0.3, name = "New Mexico",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgconstructioncomp,
name == "NewYork"), x = ~dates, y = ~avgcomp, opacity = 0.3, name = "New York",
type = "scatter", mode = "lines") %>% add_trace(data = filter(bea_avgconstructioncomp,
name == "NorthCarolina"), x = ~dates, y = ~avgcomp, opacity = 0.3, name = "North Carolina",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgconstructioncomp,
name == "NorthDakota"), x = ~dates, y = ~avgcomp, opacity = 0.3, name = "North Dakota",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgconstructioncomp,
name == "Ohio"), x = ~dates, y = ~avgcomp, opacity = 0.3, name = "Ohio", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgconstructioncomp,
name == "Oklahoma"), x = ~dates, y = ~avgcomp, opacity = 0.3, name = "Oklahoma",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgconstructioncomp,
name == "Oregon"), x = ~dates, y = ~avgcomp, opacity = 0.3, name = "Oregon",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgconstructioncomp,
name == "Pennsylvania"), x = ~dates, y = ~avgcomp, opacity = 0.3, name = "Pennsylvania",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgconstructioncomp,
name == "PuertoRico"), x = ~dates, y = ~avgcomp, opacity = 0.3, name = "Puerto Rico",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgconstructioncomp,
name == "RhodeIsland"), x = ~dates, y = ~avgcomp, opacity = 0.3, name = "Rhode Island",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgconstructioncomp,
name == "SouthCarolina"), x = ~dates, y = ~avgcomp, opacity = 0.3, name = "South Carolina",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgconstructioncomp,
name == "SouthDakota"), x = ~dates, y = ~avgcomp, opacity = 0.3, name = "South Dakota",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgconstructioncomp,
name == "Tennessee"), x = ~dates, y = ~avgcomp, opacity = 0.3, name = "Tennessee",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgconstructioncomp,
name == "Texas"), x = ~dates, y = ~avgcomp, opacity = 0.3, name = "Texas", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgconstructioncomp,
name == "Utah"), x = ~dates, y = ~avgcomp, opacity = 0.3, name = "Utah", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgconstructioncomp,
name == "Vermont"), x = ~dates, y = ~avgcomp, opacity = 0.3, name = "Vermont",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgconstructioncomp,
name == "Virginia"), x = ~dates, y = ~avgcomp, opacity = 0.3, name = "Virginia",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgconstructioncomp,
name == "Washington"), x = ~dates, y = ~avgcomp, opacity = 0.3, name = "Washington",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgconstructioncomp,
name == "WestVirginia"), x = ~dates, y = ~avgcomp, opacity = 0.3, name = "West Virginia",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgconstructioncomp,
name == "Wisconsin"), x = ~dates, y = ~avgcomp, opacity = 0.3, name = "Wisconsin",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgconstructioncomp,
name == "Wyoming"), x = ~dates, y = ~avgcomp, opacity = 0.3, name = "Wyoming",
type = "scatter", mode = "lines") %>% layout(title = "Average Compensation of Employees in Construction (2010-2018)",
xaxis = list(title = "Quarter", titlefont = f1, showticklabels = TRUE, tickfont = f2,
exponentformat = "E"), yaxis = list(title = "USD", titlefont = f1, showticklabels = TRUE,
tickfont = f2), margin = list(l = 80, r = 80, b = 100, t = 100, pad = 4))
We see that the average compensation per employee in Hawaii is one of the highest in the country.
At a glance, it looks like the relative level of compensation for construction employees determines the level of construction activity in dollars per person in the state (e.g., the activity is explained by income/benefits), but not entirely. This would imply that level of construction GDP is not entirely determined by changes in employee compensation. When employee compensation excluded, we can tease out growth and declines in material construction activity.
Real Estate GDP per Capita
Now, we also want to look at the level of real estate activity, adjusted for population, in each state.
The provided definition of real estate is as follows:
The term “real estate” is used in the SIC system and in NAICS, but it does not have the same definition in both systems. SIC definition:This major group includes real estate operators, and owners and lessors of real property, as well as buyers, sellers, developers, agents, and brokers. NAICS definition:Industries in the Real Estate subsector group establishments that are primarily engaged in renting or leasing real estate to others; managing real estate for others; selling, buying, or renting real estate for others; and providing other real estate related services, such as appraisal services.This subsector includes equity Real Estate Investment Trusts (REITs) that are primarily engaged in leasing buildings, dwellings, or other real estate property to others. Mortgage REITs are classified in Subsector 525, Funds, Trusts, and Other Financial Vehicles.
bea_realestategdp <- bea_stats %>% mutate(name = name %>% str_remove("_UnitedStates")) %>%
filter(value_id %in% c("BEA_NominalGDP_RealEstate_Dollars"), missing == 0) %>%
select(name, dates, data)
census <- census %>% mutate(year = year(dates))
bea_realestategdp <- bea_realestategdp %>% mutate(year = year(dates)) %>% select(name,
year, data) %>% distinct()
bea_realestatepercapita <- bea_realestategdp %>% full_join(mutate(census, name = name %>%
str_remove("_UnitedStates")) %>% dplyr::select("name", "data", "year"), by = c(name = "name",
year = "year")) %>% mutate(gdppercapita = data.x/data.y) %>% mutate(name = name %>%
str_remove("_UnitedStates"))
plot_ly(filter(bea_realestatepercapita, name == "Hawaii"), x = ~year, y = ~gdppercapita,
name = "Hawaii", type = "scatter", mode = "lines") %>% add_trace(data = filter(bea_realestatepercapita,
name == "Alabama"), x = ~year, y = ~gdppercapita, opacity = 0.3, name = "Alabama",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_realestatepercapita,
name == "Alaska"), x = ~year, y = ~gdppercapita, opacity = 0.3, name = "Alaska",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_realestatepercapita,
name == "Arizona"), x = ~year, y = ~gdppercapita, opacity = 0.3, name = "Arizona",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_realestatepercapita,
name == "Arkansas"), x = ~year, y = ~gdppercapita, opacity = 0.3, name = "Arkansas",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_realestatepercapita,
name == "California"), x = ~year, y = ~gdppercapita, opacity = 0.3, name = "California",
type = "scatter", mode = "lines") %>% add_trace(data = filter(bea_realestatepercapita,
name == "Colorado"), x = ~year, y = ~gdppercapita, opacity = 0.3, name = "Colorado",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_realestatepercapita,
name == "Connecticut"), x = ~year, y = ~gdppercapita, opacity = 0.3, name = "Connecticut",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_realestatepercapita,
name == "Delaware"), x = ~year, y = ~gdppercapita, opacity = 0.3, name = "Delaware",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_realestatepercapita,
name == "DistrictofColumbia"), x = ~year, y = ~gdppercapita, opacity = 0.3, name = "District of Columbia",
type = "scatter") %>% add_trace(data = filter(bea_realestatepercapita, name ==
"Florida"), x = ~year, y = ~gdppercapita, opacity = 0.3, name = "Florida", type = "scatter",
mode = "lines") %>% add_trace(data = filter(bea_realestatepercapita, name ==
"Georgia"), x = ~year, y = ~gdppercapita, opacity = 0.3, name = "Georgia", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_realestatepercapita,
name == "Idaho"), x = ~year, y = ~gdppercapita, opacity = 0.3, name = "Idaho",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_realestatepercapita,
name == "Illinois"), x = ~year, y = ~gdppercapita, opacity = 0.3, name = "Illinois",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_realestatepercapita,
name == "Indiana"), x = ~year, y = ~gdppercapita, opacity = 0.3, name = "Indiana",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_realestatepercapita,
name == "Iowa"), x = ~year, y = ~gdppercapita, opacity = 0.3, name = "Iowa",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_realestatepercapita,
name == "Kansas"), x = ~year, y = ~gdppercapita, opacity = 0.3, name = "Kansas",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_realestatepercapita,
name == "Kentucky"), x = ~year, y = ~gdppercapita, opacity = 0.3, name = "Kentucky",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_realestatepercapita,
name == "Louisiana"), x = ~year, y = ~gdppercapita, opacity = 0.3, name = "Louisiana",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_realestatepercapita,
name == "Maine"), x = ~year, y = ~gdppercapita, opacity = 0.3, name = "Maine",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_realestatepercapita,
name == "Maryland"), x = ~year, y = ~gdppercapita, opacity = 0.3, name = "Maryland",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_realestatepercapita,
name == "Massachusetts"), x = ~year, y = ~gdppercapita, opacity = 0.3, name = "Massachusetts",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_realestatepercapita,
name == "Michigan"), x = ~year, y = ~gdppercapita, opacity = 0.3, name = "Michigan",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_realestatepercapita,
name == "Minnesota"), x = ~year, y = ~gdppercapita, opacity = 0.3, name = "Minnesota",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_realestatepercapita,
name == "Mississippi"), x = ~year, y = ~gdppercapita, opacity = 0.3, name = "Mississippi",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_realestatepercapita,
name == "Missouri"), x = ~year, y = ~gdppercapita, opacity = 0.3, name = "Missouri",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_realestatepercapita,
name == "Montana"), x = ~year, y = ~gdppercapita, opacity = 0.3, name = "Montana",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_realestatepercapita,
name == "Nebraska"), x = ~year, y = ~gdppercapita, opacity = 0.3, name = "Nebraska",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_realestatepercapita,
name == "Nevada"), x = ~year, y = ~gdppercapita, opacity = 0.3, name = "Nevada",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_realestatepercapita,
name == "NewHampshire"), x = ~year, y = ~gdppercapita, opacity = 0.3, name = "New Hampshire",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_realestatepercapita,
name == "NewJersey"), x = ~year, y = ~gdppercapita, opacity = 0.3, name = "New Jersey",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_realestatepercapita,
name == "NewMexico"), x = ~year, y = ~gdppercapita, opacity = 0.3, name = "New Mexico",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_realestatepercapita,
name == "NewYork"), x = ~year, y = ~gdppercapita, opacity = 0.3, name = "New York",
type = "scatter", mode = "lines") %>% add_trace(data = filter(bea_realestatepercapita,
name == "NorthCarolina"), x = ~year, y = ~gdppercapita, opacity = 0.3, name = "North Carolina",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_realestatepercapita,
name == "NorthDakota"), x = ~year, y = ~gdppercapita, opacity = 0.3, name = "North Dakota",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_realestatepercapita,
name == "Ohio"), x = ~year, y = ~gdppercapita, opacity = 0.3, name = "Ohio",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_realestatepercapita,
name == "Oklahoma"), x = ~year, y = ~gdppercapita, opacity = 0.3, name = "Oklahoma",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_realestatepercapita,
name == "Oregon"), x = ~year, y = ~gdppercapita, opacity = 0.3, name = "Oregon",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_realestatepercapita,
name == "Pennsylvania"), x = ~year, y = ~gdppercapita, opacity = 0.3, name = "Pennsylvania",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_realestatepercapita,
name == "PuertoRico"), x = ~year, y = ~gdppercapita, opacity = 0.3, name = "Puerto Rico",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_realestatepercapita,
name == "RhodeIsland"), x = ~year, y = ~gdppercapita, opacity = 0.3, name = "Rhode Island",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_realestatepercapita,
name == "SouthCarolina"), x = ~year, y = ~gdppercapita, opacity = 0.3, name = "South Carolina",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_realestatepercapita,
name == "SouthDakota"), x = ~year, y = ~gdppercapita, opacity = 0.3, name = "South Dakota",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_realestatepercapita,
name == "Tennessee"), x = ~year, y = ~gdppercapita, opacity = 0.3, name = "Tennessee",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_realestatepercapita,
name == "Texas"), x = ~year, y = ~gdppercapita, opacity = 0.3, name = "Texas",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_realestatepercapita,
name == "Utah"), x = ~year, y = ~gdppercapita, opacity = 0.3, name = "Utah",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_realestatepercapita,
name == "Vermont"), x = ~year, y = ~gdppercapita, opacity = 0.3, name = "Vermont",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_realestatepercapita,
name == "Virginia"), x = ~year, y = ~gdppercapita, opacity = 0.3, name = "Virginia",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_realestatepercapita,
name == "Washington"), x = ~year, y = ~gdppercapita, opacity = 0.3, name = "Washington",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_realestatepercapita,
name == "WestVirginia"), x = ~year, y = ~gdppercapita, opacity = 0.3, name = "West Virginia",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_realestatepercapita,
name == "Wisconsin"), x = ~year, y = ~gdppercapita, opacity = 0.3, name = "Wisconsin",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_realestatepercapita,
name == "Wyoming"), x = ~year, y = ~gdppercapita, opacity = 0.3, name = "Wyoming",
type = "scatter", mode = "lines") %>% layout(title = "Nominal GDP of Real Estate Industries per Capita, in Dollars (2010-2020)",
xaxis = list(title = "Year", titlefont = f1, showticklabels = TRUE, tickfont = f2,
exponentformat = "E"), yaxis = list(title = "USD", titlefont = f1, showticklabels = TRUE,
tickfont = f2), margin = list(l = 80, r = 80, b = 100, t = 100, pad = 4))
The data suggests that the level of activity in real estate is on par with New York and California, when adjusted for population.
Compensation in Real Estate
bea_realestatecomp <- bea_stats %>% mutate(name = name %>% str_remove("_UnitedStates")) %>%
filter(value_id %in% c("BEA_CompensationOfEmployees_RealEstate_Dollars"), missing ==
0) %>% mutate(year = year(dates)) %>% select(name, year, data) %>% distinct()
bea_realestatejobs <- bea_stats %>% mutate(name = name %>% str_remove("_UnitedStates")) %>%
filter(value_id %in% c("BEA_Employment_RealEstate_Jobs"), missing == 0) %>% mutate(year = year(dates)) %>%
select(name, year, data) %>% distinct()
bea_avgrealestatecomp <- bea_realestatecomp %>% full_join(mutate(bea_realestatejobs,
name = name %>% str_remove("_UnitedStates")) %>% dplyr::select("name", "data",
"year"), by = c(name = "name", year = "year")) %>% mutate(avgcomp = data.x/data.y) %>%
mutate(name = name %>% str_remove("_UnitedStates"))
plot_ly(filter(bea_avgrealestatecomp, name == "Hawaii"), x = ~year, y = ~avgcomp,
name = "Hawaii", type = "scatter", mode = "lines") %>% add_trace(data = filter(bea_avgrealestatecomp,
name == "Alabama"), x = ~year, y = ~avgcomp, opacity = 0.3, name = "Alabama",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgrealestatecomp,
name == "Alaska"), x = ~year, y = ~avgcomp, opacity = 0.3, name = "Alaska", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgrealestatecomp,
name == "Arizona"), x = ~year, y = ~avgcomp, opacity = 0.3, name = "Arizona",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgrealestatecomp,
name == "Arkansas"), x = ~year, y = ~avgcomp, opacity = 0.3, name = "Arkansas",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgrealestatecomp,
name == "California"), x = ~year, y = ~avgcomp, opacity = 0.3, name = "California",
type = "scatter", mode = "lines") %>% add_trace(data = filter(bea_avgrealestatecomp,
name == "Colorado"), x = ~year, y = ~avgcomp, opacity = 0.3, name = "Colorado",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgrealestatecomp,
name == "Connecticut"), x = ~year, y = ~avgcomp, opacity = 0.3, name = "Connecticut",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgrealestatecomp,
name == "Delaware"), x = ~year, y = ~avgcomp, opacity = 0.3, name = "Delaware",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgrealestatecomp,
name == "DistrictofColumbia"), x = ~year, y = ~avgcomp, opacity = 0.3, name = "District of Columbia",
type = "scatter", mode = "lines") %>% add_trace(data = filter(bea_avgrealestatecomp,
name == "Florida"), x = ~year, y = ~avgcomp, opacity = 0.3, name = "Florida",
type = "scatter", mode = "lines") %>% add_trace(data = filter(bea_avgrealestatecomp,
name == "Georgia"), x = ~year, y = ~avgcomp, opacity = 0.3, name = "Georgia",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgrealestatecomp,
name == "Idaho"), x = ~year, y = ~avgcomp, opacity = 0.3, name = "Idaho", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgrealestatecomp,
name == "Illinois"), x = ~year, y = ~avgcomp, opacity = 0.3, name = "Illinois",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgrealestatecomp,
name == "Indiana"), x = ~year, y = ~avgcomp, opacity = 0.3, name = "Indiana",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgrealestatecomp,
name == "Iowa"), x = ~year, y = ~avgcomp, opacity = 0.3, name = "Iowa", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgrealestatecomp,
name == "Kansas"), x = ~year, y = ~avgcomp, opacity = 0.3, name = "Kansas", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgrealestatecomp,
name == "Kentucky"), x = ~year, y = ~avgcomp, opacity = 0.3, name = "Kentucky",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgrealestatecomp,
name == "Louisiana"), x = ~year, y = ~avgcomp, opacity = 0.3, name = "Louisiana",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgrealestatecomp,
name == "Maine"), x = ~year, y = ~avgcomp, opacity = 0.3, name = "Maine", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgrealestatecomp,
name == "Maryland"), x = ~year, y = ~avgcomp, opacity = 0.3, name = "Maryland",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgrealestatecomp,
name == "Massachusetts"), x = ~year, y = ~avgcomp, opacity = 0.3, name = "Massachusetts",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgrealestatecomp,
name == "Michigan"), x = ~year, y = ~avgcomp, opacity = 0.3, name = "Michigan",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgrealestatecomp,
name == "Minnesota"), x = ~year, y = ~avgcomp, opacity = 0.3, name = "Minnesota",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgrealestatecomp,
name == "Mississippi"), x = ~year, y = ~avgcomp, opacity = 0.3, name = "Mississippi",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgrealestatecomp,
name == "Missouri"), x = ~year, y = ~avgcomp, opacity = 0.3, name = "Missouri",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgrealestatecomp,
name == "Montana"), x = ~year, y = ~avgcomp, opacity = 0.3, name = "Montana",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgrealestatecomp,
name == "Nebraska"), x = ~year, y = ~avgcomp, opacity = 0.3, name = "Nebraska",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgrealestatecomp,
name == "Nevada"), x = ~year, y = ~avgcomp, opacity = 0.3, name = "Nevada", type = "scatter",
mode = "lines") %>% add_trace(data = filter(bea_avgrealestatecomp, name == "NewHampshire"),
x = ~year, y = ~avgcomp, opacity = 0.3, name = "New Hampshire", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgrealestatecomp,
name == "NewJersey"), x = ~year, y = ~avgcomp, opacity = 0.3, name = "New Jersey",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgrealestatecomp,
name == "NewMexico"), x = ~year, y = ~avgcomp, opacity = 0.3, name = "New Mexico",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgrealestatecomp,
name == "NewYork"), x = ~year, y = ~avgcomp, opacity = 0.3, name = "New York",
type = "scatter", mode = "lines") %>% add_trace(data = filter(bea_avgrealestatecomp,
name == "NorthCarolina"), x = ~year, y = ~avgcomp, opacity = 0.3, name = "North Carolina",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgrealestatecomp,
name == "NorthDakota"), x = ~year, y = ~avgcomp, opacity = 0.3, name = "North Dakota",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgrealestatecomp,
name == "Ohio"), x = ~year, y = ~avgcomp, opacity = 0.3, name = "Ohio", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgrealestatecomp,
name == "Oklahoma"), x = ~year, y = ~avgcomp, opacity = 0.3, name = "Oklahoma",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgrealestatecomp,
name == "Oregon"), x = ~year, y = ~avgcomp, opacity = 0.3, name = "Oregon", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgrealestatecomp,
name == "Pennsylvania"), x = ~year, y = ~avgcomp, opacity = 0.3, name = "Pennsylvania",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgrealestatecomp,
name == "PuertoRico"), x = ~year, y = ~avgcomp, opacity = 0.3, name = "Puerto Rico",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgrealestatecomp,
name == "RhodeIsland"), x = ~year, y = ~avgcomp, opacity = 0.3, name = "Rhode Island",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgrealestatecomp,
name == "SouthCarolina"), x = ~year, y = ~avgcomp, opacity = 0.3, name = "South Carolina",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgrealestatecomp,
name == "SouthDakota"), x = ~year, y = ~avgcomp, opacity = 0.3, name = "South Dakota",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgrealestatecomp,
name == "Tennessee"), x = ~year, y = ~avgcomp, opacity = 0.3, name = "Tennessee",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgrealestatecomp,
name == "Texas"), x = ~year, y = ~avgcomp, opacity = 0.3, name = "Texas", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgrealestatecomp,
name == "Utah"), x = ~year, y = ~avgcomp, opacity = 0.3, name = "Utah", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgrealestatecomp,
name == "Vermont"), x = ~year, y = ~avgcomp, opacity = 0.3, name = "Vermont",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgrealestatecomp,
name == "Virginia"), x = ~year, y = ~avgcomp, opacity = 0.3, name = "Virginia",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgrealestatecomp,
name == "Washington"), x = ~year, y = ~avgcomp, opacity = 0.3, name = "Washington",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgrealestatecomp,
name == "WestVirginia"), x = ~year, y = ~avgcomp, opacity = 0.3, name = "West Virginia",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgrealestatecomp,
name == "Wisconsin"), x = ~year, y = ~avgcomp, opacity = 0.3, name = "Wisconsin",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(bea_avgrealestatecomp,
name == "Wyoming"), x = ~year, y = ~avgcomp, opacity = 0.3, name = "Wyoming",
type = "scatter", mode = "lines") %>% layout(title = "Average Compensation of Employees in Real Estate (2010-2018)",
xaxis = list(title = "Quarter", titlefont = f1, showticklabels = TRUE, tickfont = f2,
exponentformat = "E"), yaxis = list(title = "USD", titlefont = f1, showticklabels = TRUE,
tickfont = f2), margin = list(l = 80, r = 80, b = 100, t = 100, pad = 4))
Presumably, the average compensation of real estate employees is relatively low because of urban-rural disparities (e.g., real estate employees in cities are compensated a lot more) or other labor/geographic differences that would drag the average compensation down (e.g., perhaps only certain types of real estate workers are compensated lucratively, while the majority are not). This could explain why the average compensation in D.C. is so high - D.C. only encompasses 1 major urban metropolitan area, but is held to the same level as states in comparison.
Again, relative levels of employee compensation only somewhat explains rankings in real estate activity adjusted for population. Given the typical value of real estate assets, one possible explanation is that the vast majority of the GDP in real estate comes from inter-firm transactions.
Trends in Real Estate
In this section, we’ll examine real estate trends across time with data from Realtor.com.
realtor_stats <- evalmetrics("outbreaklocation", list(spec = list(ids = states_list,
expressions = list("Realtor_AvgMedianListingPrice", "Realtor_AverageListingPrice",
"Realtor_AvgMedianListingPricePerSquareFeet", "Realtor_ActiveListingCount",
"Realtor_NewListingCount", "Realtor_PriceIncreasedCount", "Realtor_PriceReducedCount",
"Realtor_AvgMedianDaysOnMarket", "Realtor_AvgMedianSquareFeet"), start = "2015-01-01",
end = today, interval = "MONTH")), get_all = TRUE)
Median and Average Listing Prices
Below, we plot both the median and average listing prices by state. The gap between the average and the median is indicative of housing inequality in the state. If the average listing price is significantly higher than the median, it means that homes in the upper price percentile are dragging the average up. The higher the value of expensive homes to other homes, the greater the inequality in housing.
realtor_avgmedlisting <- realtor_stats %>% mutate(name = name %>% str_remove("_UnitedStates")) %>%
filter(value_id %in% c("Realtor_AvgMedianListingPrice", "Realtor_AverageListingPrice"),
missing == 0)
plot_ly(filter(realtor_avgmedlisting, value_id == "Realtor_AvgMedianListingPrice") %>%
filter(name == "Hawaii"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(0,100,170)"), legendgroup = "Hawaii", name = "Hawaii - Median Listing Price") %>%
add_trace(data = filter(realtor_avgmedlisting, name == "Hawaii") %>% filter(value_id ==
"Realtor_AverageListingPrice"), type = "scatter", mode = "lines", line = list(color = "rgba(0,100,170,0.4)"),
fill = "tonexty", fillcolor = "rgba(0,100,170,0.2)", legendgroup = "Hawaii",
name = "Hawaii - Average Listing Price") %>% add_trace(data = filter(realtor_avgmedlisting,
value_id == "Realtor_AvgMedianListingPrice") %>% filter(name == "Alabama"), x = ~dates,
y = ~data, type = "scatter", mode = "lines", line = list(color = "rgb(255,205,160)"),
legendgroup = "Alabama", name = "Alabama - Median Listing Price", visible = "legendonly") %>%
add_trace(data = filter(realtor_avgmedlisting, name == "Alabama") %>% filter(value_id ==
"Realtor_AverageListingPrice"), type = "scatter", mode = "lines", line = list(color = "rgba(255,205,160,0.4)"),
fill = "tonexty", fillcolor = "rgba(255,205,160,0.2)", legendgroup = "Alabama",
name = "Alabama - Average Listing Price", visible = "legendonly") %>%
add_trace(data = filter(realtor_avgmedlisting, value_id == "Realtor_AvgMedianListingPrice") %>%
filter(name == "Alaska"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(170,225,175)"), legendgroup = "Alaska", name = "Alaska - Median Listing Price",
visible = "legendonly") %>% add_trace(data = filter(realtor_avgmedlisting, name ==
"Alaska") %>% filter(value_id == "Realtor_AverageListingPrice"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(170,225,175,0.2)", line = list(color = "rgba(170,225,175,0.4)"),
legendgroup = "Alaska", name = "Alaska - Average Listing Price", visible = "legendonly") %>%
add_trace(data = filter(realtor_avgmedlisting, value_id == "Realtor_AvgMedianListingPrice") %>%
filter(name == "Arizona"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(250,170,175)"), legendgroup = "Arizona", name = "Arizona - Median Listing Price",
visible = "legendonly") %>% add_trace(data = filter(realtor_avgmedlisting, name ==
"Arizona") %>% filter(value_id == "Realtor_AverageListingPrice"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(250,170,175,0.2)", line = list(color = "rgba(250,170,175,0.4)"),
legendgroup = "Arizona", name = "Arizona - Average Listing Price", visible = "legendonly") %>%
add_trace(data = filter(realtor_avgmedlisting, value_id == "Realtor_AvgMedianListingPrice") %>%
filter(name == "Arkansas"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(220,195,235)"), legendgroup = "Arkansas", name = "Arkansas - Median Listing Price",
visible = "legendonly") %>% add_trace(data = filter(realtor_avgmedlisting,
name == "Arkansas") %>% filter(value_id == "Realtor_AverageListingPrice"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(220,195,235,0.2)", line = list(color = "rgba(220,195,235,0.4)"),
legendgroup = "Arkansas", name = "Arkansas - Average Listing Price", visible = "legendonly") %>%
add_trace(data = filter(realtor_avgmedlisting, value_id == "Realtor_AvgMedianListingPrice") %>%
filter(name == "California"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(215,190,190)"), legendgroup = "California", name = "California - Median Listing Price",
visible = "legendonly") %>% add_trace(data = filter(realtor_avgmedlisting,
name == "California") %>% filter(value_id == "Realtor_AverageListingPrice"),
type = "scatter", mode = "lines", fill = "tonexty", fillcolor = "rgba(215,190,190,0.2)",
line = list(color = "rgba(215,190,190,0.4)"), legendgroup = "California", name = "California - Average Listing Price",
visible = "legendonly") %>% add_trace(data = filter(realtor_avgmedlisting, value_id ==
"Realtor_AvgMedianListingPrice") %>% filter(name == "Colorado"), x = ~dates,
y = ~data, type = "scatter", mode = "lines", line = list(color = "rgb(250,200,235)"),
legendgroup = "Colorado", name = "Colorado - Median Listing Price", visible = "legendonly") %>%
add_trace(data = filter(realtor_avgmedlisting, name == "Colorado") %>% filter(value_id ==
"Realtor_AverageListingPrice"), type = "scatter", mode = "lines", fill = "tonexty",
fillcolor = "rgba(250,200,235,0.2)", line = list(color = "rgba(250,200,235,0.4)"),
legendgroup = "Colorado", name = "Colorado - Average Listing Price", visible = "legendonly") %>%
add_trace(data = filter(realtor_avgmedlisting, value_id == "Realtor_AvgMedianListingPrice") %>%
filter(name == "Connecticut"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(210,210,210)"), legendgroup = "Connecticut", name = "Connecticut - Median Listing Price",
visible = "legendonly") %>% add_trace(data = filter(realtor_avgmedlisting,
name == "Connecticut") %>% filter(value_id == "Realtor_AverageListingPrice"),
type = "scatter", mode = "lines", fill = "tonexty", fillcolor = "rgba(210,210,210,0.2)",
line = list(color = "rgba(210,210,210,0.4)"), legendgroup = "Connecticut", name = "Connecticut - Average Listing Price",
visible = "legendonly") %>% add_trace(data = filter(realtor_avgmedlisting, value_id ==
"Realtor_AvgMedianListingPrice") %>% filter(name == "Delaware"), x = ~dates,
y = ~data, type = "scatter", mode = "lines", line = list(color = "rgb(230,230,170)"),
legendgroup = "Delaware", name = "Delaware - Median Listing Price", visible = "legendonly") %>%
add_trace(data = filter(realtor_avgmedlisting, name == "Delaware") %>% filter(value_id ==
"Realtor_AverageListingPrice"), type = "scatter", mode = "lines", fill = "tonexty",
fillcolor = "rgba(230,230,170,0.2)", line = list(color = "rgba(230,230,170,0.4)"),
legendgroup = "Delaware", name = "Delaware - Average Listing Price", visible = "legendonly") %>%
add_trace(data = filter(realtor_avgmedlisting, value_id == "Realtor_AvgMedianListingPrice") %>%
filter(name == "DistrictofColumbia"), x = ~dates, y = ~data, type = "scatter",
mode = "lines", line = list(color = "rgb(160,235,240)"), legendgroup = "DistrictofColumbia",
name = "District of Columbia - Median Listing Price", visible = "legendonly") %>%
add_trace(data = filter(realtor_avgmedlisting, name == "DistrictofColumbia") %>%
filter(value_id == "Realtor_AverageListingPrice"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(160,235,240,0.2)", line = list(color = "rgba(160,235,240,0.4)"),
legendgroup = "DistrictofColumbia", name = "District of Columbia - Average Listing Price",
visible = "legendonly") %>% add_trace(data = filter(realtor_avgmedlisting,
value_id == "Realtor_AvgMedianListingPrice") %>% filter(name == "Florida"), x = ~dates,
y = ~data, type = "scatter", mode = "lines", line = list(color = "rgb(170,205,230)"),
legendgroup = "Florida", name = "Florida - Median Listing Price", visible = "legendonly") %>%
add_trace(data = filter(realtor_avgmedlisting, name == "Florida") %>% filter(value_id ==
"Realtor_AverageListingPrice"), type = "scatter", mode = "lines", fill = "tonexty",
fillcolor = "rgba(170,205,230,0.2)", line = list(color = "rgba(170,205,230,0.4)"),
legendgroup = "Florida", name = "Florida - Average Listing Price", visible = "legendonly") %>%
add_trace(data = filter(realtor_avgmedlisting, value_id == "Realtor_AvgMedianListingPrice") %>%
filter(name == "Georgia"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(255,205,160)"), legendgroup = "Georgia", name = "Georgia - Median Listing Price",
visible = "legendonly") %>% add_trace(data = filter(realtor_avgmedlisting,
name == "Georgia") %>% filter(value_id == "Realtor_AverageListingPrice"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(255,205,160,0.2)", line = list(color = "rgba(255,205,160,0.4)"),
legendgroup = "Georgia", name = "Georgia - Average Listing Price", visible = "legendonly") %>%
add_trace(data = filter(realtor_avgmedlisting, value_id == "Realtor_AvgMedianListingPrice") %>%
filter(name == "Idaho"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(170,225,175)"), legendgroup = "Idaho", name = "Idaho - Median Listing Price",
visible = "legendonly") %>% add_trace(data = filter(realtor_avgmedlisting,
name == "Idaho") %>% filter(value_id == "Realtor_AverageListingPrice"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(170,225,175,0.2)", line = list(color = "rgba(170,225,175,0.4)"),
legendgroup = "Idaho", name = "Idaho - Average Listing Price", visible = "legendonly") %>%
add_trace(data = filter(realtor_avgmedlisting, value_id == "Realtor_AvgMedianListingPrice") %>%
filter(name == "Illinois"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(250,175,180"), legendgroup = "Illinois", name = "Illinois - Median Listing Price",
visible = "legendonly") %>% add_trace(data = filter(realtor_avgmedlisting,
name == "Illinois") %>% filter(value_id == "Realtor_AverageListingPrice"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(250,175,180,0.2)", line = list(color = "rgba(250,175,180,0.4"),
legendgroup = "Illinois", name = "Illinois - Average Listing Price", visible = "legendonly") %>%
add_trace(data = filter(realtor_avgmedlisting, value_id == "Realtor_AvgMedianListingPrice") %>%
filter(name == "Indiana"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(220,195,235)"), legendgroup = "Indiana", name = "Indiana - Median Listing Price",
visible = "legendonly") %>% add_trace(data = filter(realtor_avgmedlisting,
name == "Indiana") %>% filter(value_id == "Realtor_AverageListingPrice"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(220,195,235,0.2)", line = list(color = "rgba(220,195,235,0.4)"),
legendgroup = "Indiana", name = "Indiana - Average Listing Price", visible = "legendonly") %>%
add_trace(data = filter(realtor_avgmedlisting, value_id == "Realtor_AvgMedianListingPrice") %>%
filter(name == "Iowa"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(215,190,190)"), legendgroup = "Iowa", name = "Iowa - Median Listing Price",
visible = "legendonly") %>% add_trace(data = filter(realtor_avgmedlisting,
name == "Iowa") %>% filter(value_id == "Realtor_AverageListingPrice"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(215,190,190,0.2)", line = list(color = "rgba(215,190,190,0.4)"),
legendgroup = "Iowa", name = "Iowa - Average Listing Price", visible = "legendonly") %>%
add_trace(data = filter(realtor_avgmedlisting, value_id == "Realtor_AvgMedianListingPrice") %>%
filter(name == "Kansas"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(250,200,235)"), legendgroup = "Kansas", name = "Kansas - Median Listing Price",
visible = "legendonly") %>% add_trace(data = filter(realtor_avgmedlisting,
name == "Kansas") %>% filter(value_id == "Realtor_AverageListingPrice"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(250,200,235,0.2)", line = list(color = "rgba(250,200,235,0.4)"),
legendgroup = "Kansas", name = "Kansas - Average Listing Price", visible = "legendonly") %>%
add_trace(data = filter(realtor_avgmedlisting, value_id == "Realtor_AvgMedianListingPrice") %>%
filter(name == "Kentucky"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(210,210,210)"), legendgroup = "Kentucky", name = "Kentucky - Median Listing Price",
visible = "legendonly") %>% add_trace(data = filter(realtor_avgmedlisting,
name == "Kentucky") %>% filter(value_id == "Realtor_AverageListingPrice"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(210,210,210,0.2)", line = list(color = "rgba(210,210,210,0.4)"),
legendgroup = "Kentucky", name = "Kentucky - Average Listing Price", visible = "legendonly") %>%
add_trace(data = filter(realtor_avgmedlisting, value_id == "Realtor_AvgMedianListingPrice") %>%
filter(name == "Louisiana"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(230,235,170)"), legendgroup = "Louisiana", name = "Louisiana - Median Listing Price",
visible = "legendonly") %>% add_trace(data = filter(realtor_avgmedlisting,
name == "Louisiana") %>% filter(value_id == "Realtor_AverageListingPrice"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(230,235,170,0.2)", line = list(color = "rgba(230,235,170,0.4)"),
legendgroup = "Louisiana", name = "Louisiana - Average Listing Price", visible = "legendonly") %>%
add_trace(data = filter(realtor_avgmedlisting, value_id == "Realtor_AvgMedianListingPrice") %>%
filter(name == "Maine"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(160,235,240)"), legendgroup = "Maine", name = "Maine - Median Listing Price",
visible = "legendonly") %>% add_trace(data = filter(realtor_avgmedlisting,
name == "Maine") %>% filter(value_id == "Realtor_AverageListingPrice"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(160,235,240,0.2)", line = list(color = "rgba(160,235,240,0.4)"),
legendgroup = "Maine", name = "Maine - Average Listing Price", visible = "legendonly") %>%
add_trace(data = filter(realtor_avgmedlisting, value_id == "Realtor_AvgMedianListingPrice") %>%
filter(name == "Maryland"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(170,205,230)"), legendgroup = "Maryland", name = "Maryland - Median Listing Price",
visible = "legendonly") %>% add_trace(data = filter(realtor_avgmedlisting,
name == "Maryland") %>% filter(value_id == "Realtor_AverageListingPrice"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(170,205,230,0.2)", line = list(color = "rgba(170,205,230,0.4)"),
legendgroup = "Maryland", name = "Maryland - Average Listing Price", visible = "legendonly") %>%
add_trace(data = filter(realtor_avgmedlisting, value_id == "Realtor_AvgMedianListingPrice") %>%
filter(name == "Massachusetts"), x = ~dates, y = ~data, type = "scatter",
mode = "lines", line = list(color = "rgb(255,205,160)"), legendgroup = "Massachusetts",
name = "Massachusetts - Median Listing Price", visible = "legendonly") %>%
add_trace(data = filter(realtor_avgmedlisting, name == "Massachusetts") %>% filter(value_id ==
"Realtor_AverageListingPrice"), type = "scatter", mode = "lines", fill = "tonexty",
fillcolor = "rgba(255,205,160,0.2)", line = list(color = "rgba(255,205,160,0.4)"),
legendgroup = "Massachusetts", name = "Massachusetts - Average Listing Price",
visible = "legendonly") %>% add_trace(data = filter(realtor_avgmedlisting,
value_id == "Realtor_AvgMedianListingPrice") %>% filter(name == "Michigan"),
x = ~dates, y = ~data, type = "scatter", mode = "lines", line = list(color = "rgb(170,225,175)"),
legendgroup = "Michigan", name = "Michigan - Median Listing Price", visible = "legendonly") %>%
add_trace(data = filter(realtor_avgmedlisting, name == "Michigan") %>% filter(value_id ==
"Realtor_AverageListingPrice"), type = "scatter", mode = "lines", fill = "tonexty",
fillcolor = "rgba(170,225,175,0.2)", line = list(color = "rgba(170,225,175,0.4)"),
legendgroup = "Michigan", name = "Michigan - Average Listing Price", visible = "legendonly") %>%
add_trace(data = filter(realtor_avgmedlisting, value_id == "Realtor_AvgMedianListingPrice") %>%
filter(name == "Minnesota"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(250,170,175)"), legendgroup = "Minnesota", name = "Minnesota - Median Listing Price",
visible = "legendonly") %>% add_trace(data = filter(realtor_avgmedlisting,
name == "Minnesota") %>% filter(value_id == "Realtor_AverageListingPrice"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(250,170,175,0.2)", line = list(color = "rgba(250,170,175,0.4)"),
legendgroup = "Minnesota", name = "Minnesota - Average Listing Price", visible = "legendonly") %>%
add_trace(data = filter(realtor_avgmedlisting, value_id == "Realtor_AvgMedianListingPrice") %>%
filter(name == "Mississippi"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(220,195,235)"), legendgroup = "Mississippi", name = "Mississippi - Median Listing Price",
visible = "legendonly") %>% add_trace(data = filter(realtor_avgmedlisting,
name == "Mississippi") %>% filter(value_id == "Realtor_AverageListingPrice"),
type = "scatter", mode = "lines", fill = "tonexty", fillcolor = "rgba(220,195,235,0.2)",
line = list(color = "rgba(220,195,235,0.4)"), legendgroup = "Mississippi", name = "Mississippi - Average Listing Price",
visible = "legendonly") %>% add_trace(data = filter(realtor_avgmedlisting, value_id ==
"Realtor_AvgMedianListingPrice") %>% filter(name == "Missouri"), x = ~dates,
y = ~data, type = "scatter", mode = "lines", line = list(color = "rgb(215,190,190)"),
legendgroup = "Missouri", name = "Missouri - Median Listing Price", visible = "legendonly") %>%
add_trace(data = filter(realtor_avgmedlisting, name == "Missouri") %>% filter(value_id ==
"Realtor_AverageListingPrice"), type = "scatter", mode = "lines", fill = "tonexty",
fillcolor = "rgba(215,190,190,0.2)", line = list(color = "rgba(215,190,190,0.4)"),
legendgroup = "Missouri", name = "Missouri - Average Listing Price", visible = "legendonly") %>%
add_trace(data = filter(realtor_avgmedlisting, value_id == "Realtor_AvgMedianListingPrice") %>%
filter(name == "Montana"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(250,200,235)"), legendgroup = "Montana", name = "Montana - Median Listing Price",
visible = "legendonly") %>% add_trace(data = filter(realtor_avgmedlisting,
name == "Montana") %>% filter(value_id == "Realtor_AverageListingPrice"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(250,200,235,0.2)", line = list(color = "rgba(250,200,235,0.4)"),
legendgroup = "Montana", name = "Montana - Average Listing Price", visible = "legendonly") %>%
add_trace(data = filter(realtor_avgmedlisting, value_id == "Realtor_AvgMedianListingPrice") %>%
filter(name == "Nebraska"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(210,210,210)"), legendgroup = "Nebraska", name = "Nebraska - Median Listing Price",
visible = "legendonly") %>% add_trace(data = filter(realtor_avgmedlisting,
name == "Nebraska") %>% filter(value_id == "Realtor_AverageListingPrice"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(210,210,210,0.2)", line = list(color = "rgba(210,210,210,0.4)"),
legendgroup = "Nebraska", name = "Nebraska - Average Listing Price", visible = "legendonly") %>%
add_trace(data = filter(realtor_avgmedlisting, value_id == "Realtor_AvgMedianListingPrice") %>%
filter(name == "Nevada"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(230,235,170)"), legendgroup = "Nevada", name = "Nevada - Median Listing Price",
visible = "legendonly") %>% add_trace(data = filter(realtor_avgmedlisting,
name == "Nevada") %>% filter(value_id == "Realtor_AverageListingPrice"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(230,235,170,0.2)", line = list(color = "rgba(230,235,170,0.4)"),
legendgroup = "Nevada", name = "Nevada - Average Listing Price", visible = "legendonly") %>%
add_trace(data = filter(realtor_avgmedlisting, value_id == "Realtor_AvgMedianListingPrice") %>%
filter(name == "NewHampshire"), x = ~dates, y = ~data, type = "scatter",
mode = "lines", line = list(color = "rgb(160,235,240)"), legendgroup = "NewHampshire",
name = "New Hampshire - Median Listing Price", visible = "legendonly") %>%
add_trace(data = filter(realtor_avgmedlisting, name == "NewHampshire") %>% filter(value_id ==
"Realtor_AverageListingPrice"), type = "scatter", mode = "lines", fill = "tonexty",
fillcolor = "rgba(160,235,240,0.2)", line = list(color = "rgba(160,235,240,0.4)"),
legendgroup = "NewHampshire", name = "New Hampshire - Average Listing Price",
visible = "legendonly") %>% add_trace(data = filter(realtor_avgmedlisting,
value_id == "Realtor_AvgMedianListingPrice") %>% filter(name == "NewJersey"),
x = ~dates, y = ~data, type = "scatter", mode = "lines", line = list(color = "rgb(170,205,230)"),
legendgroup = "NewJersey", name = "New Jersey - Median Listing Price", visible = "legendonly") %>%
add_trace(data = filter(realtor_avgmedlisting, name == "NewJersey") %>% filter(value_id ==
"Realtor_AverageListingPrice"), type = "scatter", mode = "lines", fill = "tonexty",
fillcolor = "rgba(170,205,230,0.2)", line = list(color = "rgba(170,205,230,0.4)"),
legendgroup = "NewJersey", name = "New Jersey - Average Listing Price", visible = "legendonly") %>%
add_trace(data = filter(realtor_avgmedlisting, value_id == "Realtor_AvgMedianListingPrice") %>%
filter(name == "NewMexico"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(255,205,160)"), legendgroup = "NewMexico", name = "New Mexico - Median Listing Price",
visible = "legendonly") %>% add_trace(data = filter(realtor_avgmedlisting,
name == "NewMexico") %>% filter(value_id == "Realtor_AverageListingPrice"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(255,205,160,0.2)", line = list(color = "rgba(255,205,160,0.4)"),
legendgroup = "NewMexico", name = "New Mexico - Average Listing Price", visible = "legendonly") %>%
add_trace(data = filter(realtor_avgmedlisting, value_id == "Realtor_AvgMedianListingPrice") %>%
filter(name == "NewYork"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(170,225,175)"), legendgroup = "NewYork", name = "New York - Median Listing Price",
visible = "legendonly") %>% add_trace(data = filter(realtor_avgmedlisting,
name == "NewYork") %>% filter(value_id == "Realtor_AverageListingPrice"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(170,225,175,0.2)", line = list(color = "rgba(170,225,175,0.4)"),
legendgroup = "NewYork", name = "New York - Average Listing Price", visible = "legendonly") %>%
add_trace(data = filter(realtor_avgmedlisting, value_id == "Realtor_AvgMedianListingPrice") %>%
filter(name == "NorthCarolina"), x = ~dates, y = ~data, type = "scatter",
mode = "lines", line = list(color = "rgb(250,170,175)"), legendgroup = "NorthCarolina",
name = "North Carolina - Median Listing Price", visible = "legendonly") %>%
add_trace(data = filter(realtor_avgmedlisting, name == "NorthCarolina") %>% filter(value_id ==
"Realtor_AverageListingPrice"), type = "scatter", mode = "lines", fill = "tonexty",
fillcolor = "rgba(250,170,175,0.2)", line = list(color = "rgba(250,170,175,0.4)"),
legendgroup = "NorthCarolina", name = "North Carolina - Average Listing Price",
visible = "legendonly") %>% add_trace(data = filter(realtor_avgmedlisting,
value_id == "Realtor_AvgMedianListingPrice") %>% filter(name == "NorthDakota"),
x = ~dates, y = ~data, type = "scatter", mode = "lines", line = list(color = "rgb(220,195,235)"),
legendgroup = "NorthDakota", name = "North Dakota - Median Listing Price", visible = "legendonly") %>%
add_trace(data = filter(realtor_avgmedlisting, name == "NorthDakota") %>% filter(value_id ==
"Realtor_AverageListingPrice"), type = "scatter", mode = "lines", fill = "tonexty",
fillcolor = "rgba(220,195,235,0.2)", line = list(color = "rgba(220,195,235,0.4)"),
legendgroup = "NorthDakota", name = "North Dakota - Average Listing Price",
visible = "legendonly") %>% add_trace(data = filter(realtor_avgmedlisting,
value_id == "Realtor_AvgMedianListingPrice") %>% filter(name == "Ohio"), x = ~dates,
y = ~data, type = "scatter", mode = "lines", line = list(color = "rgb(215,190,190)"),
legendgroup = "Ohio", name = "Ohio - Median Listing Price", visible = "legendonly") %>%
add_trace(data = filter(realtor_avgmedlisting, name == "Ohio") %>% filter(value_id ==
"Realtor_AverageListingPrice"), type = "scatter", mode = "lines", fill = "tonexty",
fillcolor = "rgba(215,190,190,0.2)", line = list(color = "rgba(215,190,190,0.4)"),
legendgroup = "Ohio", name = "Ohio - Average Listing Price", visible = "legendonly") %>%
add_trace(data = filter(realtor_avgmedlisting, value_id == "Realtor_AvgMedianListingPrice") %>%
filter(name == "Oklahoma"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(250,200,235)"), legendgroup = "Oklahoma", name = "Oklahoma - Median Listing Price",
visible = "legendonly") %>% add_trace(data = filter(realtor_avgmedlisting,
name == "Oklahoma") %>% filter(value_id == "Realtor_AverageListingPrice"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(250,200,235,0.2)", line = list(color = "rgba(250,200,235,0.4)"),
legendgroup = "Oklahoma", name = "Oklahoma - Average Listing Price", visible = "legendonly") %>%
add_trace(data = filter(realtor_avgmedlisting, value_id == "Realtor_AvgMedianListingPrice") %>%
filter(name == "Oregon"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(210,210,210)"), legendgroup = "Oregon", name = "Oregon - Median Listing Price",
visible = "legendonly") %>% add_trace(data = filter(realtor_avgmedlisting,
name == "Oregon") %>% filter(value_id == "Realtor_AverageListingPrice"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(210,210,210,0.2)", line = list(color = "rgba(210,210,210,0.4)"),
legendgroup = "Oregon", name = "Oregon - Average Listing Price", visible = "legendonly") %>%
add_trace(data = filter(realtor_avgmedlisting, value_id == "Realtor_AvgMedianListingPrice") %>%
filter(name == "Pennsylvania"), x = ~dates, y = ~data, type = "scatter",
mode = "lines", line = list(color = "rgb(230,235,170)"), legendgroup = "Pennsylvania",
name = "Pennsylvania - Median Listing Price", visible = "legendonly") %>%
add_trace(data = filter(realtor_avgmedlisting, name == "Pennsylvania") %>% filter(value_id ==
"Realtor_AverageListingPrice"), type = "scatter", mode = "lines", fill = "tonexty",
fillcolor = "rgba(230,235,170,0.2)", line = list(color = "rgba(230,235,170,0.4)"),
legendgroup = "Pennsylvania", name = "Pennsylvania - Average Listing Price",
visible = "legendonly") %>% add_trace(data = filter(realtor_avgmedlisting,
value_id == "Realtor_AvgMedianListingPrice") %>% filter(name == "PuertoRico"),
x = ~dates, y = ~data, type = "scatter", mode = "lines", line = list(color = "rgb(160,235,240)"),
legendgroup = "PuertoRico", name = "Puerto Rico - Median Listing Price", visible = "legendonly") %>%
add_trace(data = filter(realtor_avgmedlisting, name == "PuertoRico") %>% filter(value_id ==
"Realtor_AverageListingPrice"), type = "scatter", mode = "lines", fill = "tonexty",
fillcolor = "rgba(160,235,240,0.2)", line = list(color = "rgba(160,235,240,0.4)"),
legendgroup = "PuertoRico", name = "Puerto Rico - Average Listing Price",
visible = "legendonly") %>% add_trace(data = filter(realtor_avgmedlisting,
value_id == "Realtor_AvgMedianListingPrice") %>% filter(name == "RhodeIsland"),
x = ~dates, y = ~data, type = "scatter", mode = "lines", line = list(color = "rgb(170,205,230)"),
legendgroup = "RhodeIsland", name = "Rhode Island - Median Listing Price", visible = "legendonly") %>%
add_trace(data = filter(realtor_avgmedlisting, name == "RhodeIsland") %>% filter(value_id ==
"Realtor_AverageListingPrice"), type = "scatter", mode = "lines", fill = "tonexty",
fillcolor = "rgba(170,205,230,0.2)", line = list(color = "rgba(170,205,230,0.4)"),
legendgroup = "RhodeIsland", name = "Rhode Island - Average Listing Price",
visible = "legendonly") %>% add_trace(data = filter(realtor_avgmedlisting,
value_id == "Realtor_AvgMedianListingPrice") %>% filter(name == "SouthCarolina"),
x = ~dates, y = ~data, type = "scatter", mode = "lines", line = list(color = "rgb(255,205,160)"),
legendgroup = "SouthCarolina", name = "South Carolina - Median Listing Price",
visible = "legendonly") %>% add_trace(data = filter(realtor_avgmedlisting, name ==
"SouthCarolina") %>% filter(value_id == "Realtor_AverageListingPrice"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(255,205,160,0.2)", line = list(color = "rgba(255,205,160,0.4)"),
legendgroup = "SouthCarolina", name = "South Carolina - Average Listing Price",
visible = "legendonly") %>% add_trace(data = filter(realtor_avgmedlisting, value_id ==
"Realtor_AvgMedianListingPrice") %>% filter(name == "SouthDakota"), x = ~dates,
y = ~data, type = "scatter", mode = "lines", line = list(color = "rgb(170,225,175)"),
legendgroup = "SouthDakota", name = "South Dakota - Median Listing Price", visible = "legendonly") %>%
add_trace(data = filter(realtor_avgmedlisting, name == "SouthDakota") %>% filter(value_id ==
"Realtor_AverageListingPrice"), type = "scatter", mode = "lines", fill = "tonexty",
fillcolor = "rgba(170,225,175,0.2)", line = list(color = "rgba(170,225,175,0.4)"),
legendgroup = "SouthDakota", name = "South Dakota - Average Listing Price",
visible = "legendonly") %>% add_trace(data = filter(realtor_avgmedlisting,
value_id == "Realtor_AvgMedianListingPrice") %>% filter(name == "Tennessee"),
x = ~dates, y = ~data, type = "scatter", mode = "lines", line = list(color = "rgb(250,170,175)"),
legendgroup = "Tennessee", name = "Tennessee - Median Listing Price", visible = "legendonly") %>%
add_trace(data = filter(realtor_avgmedlisting, name == "Tennessee") %>% filter(value_id ==
"Realtor_AverageListingPrice"), type = "scatter", mode = "lines", fill = "tonexty",
fillcolor = "rgba(250,170,175,0.2)", line = list(color = "rgba(250,170,175,0.4)"),
legendgroup = "Tennessee", name = "Tennessee - Average Listing Price", visible = "legendonly") %>%
add_trace(data = filter(realtor_avgmedlisting, value_id == "Realtor_AvgMedianListingPrice") %>%
filter(name == "Texas"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(220,195,235)"), legendgroup = "Texas", name = "Texas - Median Listing Price",
visible = "legendonly") %>% add_trace(data = filter(realtor_avgmedlisting,
name == "Texas") %>% filter(value_id == "Realtor_AverageListingPrice"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(220,195,235,0.2)", line = list(color = "rgba(220,195,235,0.4)"),
legendgroup = "Texas", name = "Texas - Average Listing Price", visible = "legendonly") %>%
add_trace(data = filter(realtor_avgmedlisting, value_id == "Realtor_AvgMedianListingPrice") %>%
filter(name == "Utah"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(215,190,190)"), legendgroup = "Utah", name = "Utah - Median Listing Price",
visible = "legendonly") %>% add_trace(data = filter(realtor_avgmedlisting,
name == "Utah") %>% filter(value_id == "Realtor_AverageListingPrice"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(215,190,190,0.2)", line = list(color = "rgba(215,190,190,0.4)"),
legendgroup = "Utah", name = "Utah - Average Listing Price", visible = "legendonly") %>%
add_trace(data = filter(realtor_avgmedlisting, value_id == "Realtor_AvgMedianListingPrice") %>%
filter(name == "Vermont"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(250,200,235)"), legendgroup = "Vermont", name = "Vermont - Median Listing Price",
visible = "legendonly") %>% add_trace(data = filter(realtor_avgmedlisting,
name == "Vermont") %>% filter(value_id == "Realtor_AverageListingPrice"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(250,200,235,0.2)", line = list(color = "rgba(250,200,235,0.4)"),
legendgroup = "Vermont", name = "Vermont - Average Listing Price", visible = "legendonly") %>%
add_trace(data = filter(realtor_avgmedlisting, value_id == "Realtor_AvgMedianListingPrice") %>%
filter(name == "Virginia"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(210,210,210)"), legendgroup = "Virginia", name = "Virginia - Median Listing Price",
visible = "legendonly") %>% add_trace(data = filter(realtor_avgmedlisting,
name == "Virginia") %>% filter(value_id == "Realtor_AverageListingPrice"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(210,210,210,0.2)", line = list(color = "rgba(210,210,210,0.4)"),
legendgroup = "Virginia", name = "Virginia - Average Listing Price", visible = "legendonly") %>%
add_trace(data = filter(realtor_avgmedlisting, value_id == "Realtor_AvgMedianListingPrice") %>%
filter(name == "Washington"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(230,235,170)"), legendgroup = "Washington", name = "Washington - Median Listing Price",
visible = "legendonly") %>% add_trace(data = filter(realtor_avgmedlisting,
name == "Washington") %>% filter(value_id == "Realtor_AverageListingPrice"),
type = "scatter", mode = "lines", fill = "tonexty", fillcolor = "rgba(230,235,170,0.2)",
line = list(color = "rgba(230,235,170,0.4)"), legendgroup = "Washington", name = "Washington - Average Listing Price",
visible = "legendonly") %>% add_trace(data = filter(realtor_avgmedlisting, value_id ==
"Realtor_AvgMedianListingPrice") %>% filter(name == "WestVirginia"), x = ~dates,
y = ~data, type = "scatter", mode = "lines", line = list(color = "rgb(160,235,240)"),
legendgroup = "WestVirginia", name = "West Virginia - Median Listing Price",
visible = "legendonly") %>% add_trace(data = filter(realtor_avgmedlisting, name ==
"WestVirginia") %>% filter(value_id == "Realtor_AverageListingPrice"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(160,235,240,0.2)", line = list(color = "rgba(160,235,240,0.4)"),
legendgroup = "WestVirginia", name = "West Virginia - Average Listing Price",
visible = "legendonly") %>% add_trace(data = filter(realtor_avgmedlisting, value_id ==
"Realtor_AvgMedianListingPrice") %>% filter(name == "Wisconsin"), x = ~dates,
y = ~data, type = "scatter", mode = "lines", line = list(color = "rgb(170,205,230)"),
legendgroup = "Wisconsin", name = "Wisconsin - Median Listing Price", visible = "legendonly") %>%
add_trace(data = filter(realtor_avgmedlisting, name == "Wisconsin") %>% filter(value_id ==
"Realtor_AverageListingPrice"), type = "scatter", mode = "lines", fill = "tonexty",
fillcolor = "rgba(170,205,230,0.2)", line = list(color = "rgba(170,205,230,0.4)"),
legendgroup = "Wisconsin", name = "Wisconsin - Average Listing Price", visible = "legendonly") %>%
add_trace(data = filter(realtor_avgmedlisting, value_id == "Realtor_AvgMedianListingPrice") %>%
filter(name == "Wyoming"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(255,210,165)"), legendgroup = "Wyoming", name = "Wyoming - Median Listing Price") %>%
add_trace(data = filter(realtor_avgmedlisting, name == "Wyoming") %>% filter(value_id ==
"Realtor_AverageListingPrice"), type = "scatter", mode = "lines", fill = "tonexty",
fillcolor = "rgba(255,210,165,0.2)", line = list(color = "rgba(255,210,165,0.4)"),
legendgroup = "Wyoming", name = "Wyoming - Average Listing Price") %>% layout(title = "Median and Average Listing Prices (07/2016-11/2020)",
paper_bgcolor = "rgb(200,200,200)", plot_bgcolor = "rgb(150,150,150)", xaxis = list(title = "Month",
gridcolor = "rgb(255,255,255)", showgrid = TRUE, showline = FALSE, showticklabels = TRUE,
tickcolor = "rgb(127,127,127)", ticks = "outside", zeroline = FALSE), yaxis = list(title = "USD",
gridcolor = "rgb(255,255,255)", showgrid = TRUE, showline = FALSE, showticklabels = TRUE,
tickcolor = "rgb(127,127,127)", ticks = "outside", zeroline = FALSE), margin = list(l = 80,
r = 80, b = 75, t = 100, pad = 4))
From the start of 2020, it looks like there was a fall in the average listing prices in Hawaii and a smaller dip in median listing prices. This is likely due to lower listing prices for luxury homes, or new luxury listings are purposefully delayed/withdrawn. In terms of the market, the pandemic had an equalizing effect on listings (at least superficially).
In contrast, Wyoming has had a boom in the supply of luxury housing beginning in April 2019 (and deflating around April 2020) that has widened the inequality in the state’s housing stock.
One hypothesis for explaining the deflation of the luxury Hawaii real estate market in March to June is that, unlike vacation homes on mainland states (like Florida, which saw a steady increase in average prices), the pandemic has introduced significant uncertainties about the feasibility of readily flying to homes in Hawaii. As such, demand may have gone down or supply may have gone up as vacation/investment home owners rush to sell.
Median Price per Square Feet
realtor_medsqft <- realtor_stats %>% mutate(name = name %>% str_remove("_UnitedStates")) %>%
filter(value_id %in% c("Realtor_AvgMedianListingPricePerSquareFeet"), missing ==
0) %>% select(name, dates, data)
plot_ly(filter(realtor_medsqft, name == "Hawaii"), x = ~dates, y = ~data, name = "Hawaii",
type = "scatter", mode = "lines") %>% add_trace(data = filter(realtor_medsqft,
name == "Alabama"), x = ~dates, y = ~data, opacity = 0.3, name = "Alabama", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_medsqft,
name == "Alaska"), x = ~dates, y = ~data, opacity = 0.3, name = "Alaska", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_medsqft,
name == "Arizona"), x = ~dates, y = ~data, opacity = 0.3, name = "Arizona", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_medsqft,
name == "Arkansas"), x = ~dates, y = ~data, opacity = 0.3, name = "Arkansas",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_medsqft,
name == "California"), x = ~dates, y = ~data, opacity = 0.3, name = "California",
type = "scatter", mode = "lines") %>% add_trace(data = filter(realtor_medsqft,
name == "Colorado"), x = ~dates, y = ~data, opacity = 0.3, name = "Colorado",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_medsqft,
name == "Connecticut"), x = ~dates, y = ~data, opacity = 0.3, name = "Connecticut",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_medsqft,
name == "Delaware"), x = ~dates, y = ~data, opacity = 0.3, name = "Delaware",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_medsqft,
name == "DistrictofColumbia"), x = ~dates, y = ~data, opacity = 0.3, name = "District of Columbia",
type = "scatter", mode = "lines") %>% add_trace(data = filter(realtor_medsqft,
name == "Florida"), x = ~dates, y = ~data, opacity = 0.3, name = "Florida", type = "scatter",
mode = "lines") %>% add_trace(data = filter(realtor_medsqft, name == "Georgia"),
x = ~dates, y = ~data, opacity = 0.3, name = "Georgia", type = "scatter", mode = "lines",
visible = "legendonly") %>% add_trace(data = filter(realtor_medsqft, name ==
"Idaho"), x = ~dates, y = ~data, opacity = 0.3, name = "Idaho", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_medsqft,
name == "Illinois"), x = ~dates, y = ~data, opacity = 0.3, name = "Illinois",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_medsqft,
name == "Indiana"), x = ~dates, y = ~data, opacity = 0.3, name = "Indiana", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_medsqft,
name == "Iowa"), x = ~dates, y = ~data, opacity = 0.3, name = "Iowa", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_medsqft,
name == "Kansas"), x = ~dates, y = ~data, opacity = 0.3, name = "Kansas", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_medsqft,
name == "Kentucky"), x = ~dates, y = ~data, opacity = 0.3, name = "Kentucky",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_medsqft,
name == "Louisiana"), x = ~dates, y = ~data, opacity = 0.3, name = "Louisiana",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_medsqft,
name == "Maine"), x = ~dates, y = ~data, opacity = 0.3, name = "Maine", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_medsqft,
name == "Maryland"), x = ~dates, y = ~data, opacity = 0.3, name = "Maryland",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_medsqft,
name == "Massachusetts"), x = ~dates, y = ~data, opacity = 0.3, name = "Massachusetts",
type = "scatter", mode = "lines") %>% add_trace(data = filter(realtor_medsqft,
name == "Michigan"), x = ~dates, y = ~data, opacity = 0.3, name = "Michigan",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_medsqft,
name == "Minnesota"), x = ~dates, y = ~data, opacity = 0.3, name = "Minnesota",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_medsqft,
name == "Mississippi"), x = ~dates, y = ~data, opacity = 0.3, name = "Mississippi",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_medsqft,
name == "Missouri"), x = ~dates, y = ~data, opacity = 0.3, name = "Missouri",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_medsqft,
name == "Montana"), x = ~dates, y = ~data, opacity = 0.3, name = "Montana", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_medsqft,
name == "Nebraska"), x = ~dates, y = ~data, opacity = 0.3, name = "Nebraska",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_medsqft,
name == "Nevada"), x = ~dates, y = ~data, opacity = 0.3, name = "Nevada", type = "scatter",
mode = "lines") %>% add_trace(data = filter(realtor_medsqft, name == "NewHampshire"),
x = ~dates, y = ~data, opacity = 0.3, name = "New Hampshire", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_medsqft,
name == "NewJersey"), x = ~dates, y = ~data, opacity = 0.3, name = "New Jersey",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_medsqft,
name == "NewMexico"), x = ~dates, y = ~data, opacity = 0.3, name = "New Mexico",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_medsqft,
name == "NewYork"), x = ~dates, y = ~data, opacity = 0.3, name = "New York",
type = "scatter", mode = "lines") %>% add_trace(data = filter(realtor_medsqft,
name == "NorthCarolina"), x = ~dates, y = ~data, opacity = 0.3, name = "North Carolina",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_medsqft,
name == "NorthDakota"), x = ~dates, y = ~data, opacity = 0.3, name = "North Dakota",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_medsqft,
name == "Ohio"), x = ~dates, y = ~data, opacity = 0.3, name = "Ohio", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_medsqft,
name == "Oklahoma"), x = ~dates, y = ~data, opacity = 0.3, name = "Oklahoma",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_medsqft,
name == "Oregon"), x = ~dates, y = ~data, opacity = 0.3, name = "Oregon", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_medsqft,
name == "Pennsylvania"), x = ~dates, y = ~data, opacity = 0.3, name = "Pennsylvania",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_medsqft,
name == "PuertoRico"), x = ~dates, y = ~data, opacity = 0.3, name = "Puerto Rico",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_medsqft,
name == "RhodeIsland"), x = ~dates, y = ~data, opacity = 0.3, name = "Rhode Island",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_medsqft,
name == "SouthCarolina"), x = ~dates, y = ~data, opacity = 0.3, name = "South Carolina",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_medsqft,
name == "SouthDakota"), x = ~dates, y = ~data, opacity = 0.3, name = "South Dakota",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_medsqft,
name == "Tennessee"), x = ~dates, y = ~data, opacity = 0.3, name = "Tennessee",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_medsqft,
name == "Texas"), x = ~dates, y = ~data, opacity = 0.3, name = "Texas", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_medsqft,
name == "Utah"), x = ~dates, y = ~data, opacity = 0.3, name = "Utah", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_medsqft,
name == "Vermont"), x = ~dates, y = ~data, opacity = 0.3, name = "Vermont", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_medsqft,
name == "Virginia"), x = ~dates, y = ~data, opacity = 0.3, name = "Virginia",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_medsqft,
name == "Washington"), x = ~dates, y = ~data, opacity = 0.3, name = "Washington",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_medsqft,
name == "WestVirginia"), x = ~dates, y = ~data, opacity = 0.3, name = "West Virginia",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_medsqft,
name == "Wisconsin"), x = ~dates, y = ~data, opacity = 0.3, name = "Wisconsin",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_medsqft,
name == "Wyoming"), x = ~dates, y = ~data, opacity = 0.3, name = "Wyoming", type = "scatter",
mode = "lines") %>% layout(title = "Median Price per Square Feet (07/2016-11/2020)",
xaxis = list(title = "Month", titlefont = f1, showticklabels = TRUE, tickfont = f2,
exponentformat = "E"), yaxis = list(title = "USD", titlefont = f1, showticklabels = TRUE,
tickfont = f2), margin = list(l = 80, r = 80, b = 100, t = 100, pad = 4))
When looking at the median price per square feet, we can see a dip in prices that approximately matches with the median drop in listing prices.
Median Square Feet
realtor_sqft <- realtor_stats %>% mutate(name = name %>% str_remove("_UnitedStates")) %>%
filter(value_id %in% c("Realtor_AvgMedianSquareFeet"), missing == 0) %>% select(name,
dates, data)
plot_ly(filter(realtor_sqft, name == "Hawaii"), x = ~dates, y = ~data, name = "Hawaii",
type = "scatter", mode = "lines") %>% add_trace(data = filter(realtor_sqft, name ==
"Alabama"), x = ~dates, y = ~data, opacity = 0.3, name = "Alabama", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_sqft,
name == "Alaska"), x = ~dates, y = ~data, opacity = 0.3, name = "Alaska", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_sqft,
name == "Arizona"), x = ~dates, y = ~data, opacity = 0.3, name = "Arizona", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_sqft,
name == "Arkansas"), x = ~dates, y = ~data, opacity = 0.3, name = "Arkansas",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_sqft,
name == "California"), x = ~dates, y = ~data, opacity = 0.3, name = "California",
type = "scatter", mode = "lines") %>% add_trace(data = filter(realtor_sqft, name ==
"Colorado"), x = ~dates, y = ~data, opacity = 0.3, name = "Colorado", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_sqft,
name == "Connecticut"), x = ~dates, y = ~data, opacity = 0.3, name = "Connecticut",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_sqft,
name == "Delaware"), x = ~dates, y = ~data, opacity = 0.3, name = "Delaware",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_sqft,
name == "DistrictofColumbia"), x = ~dates, y = ~data, opacity = 0.3, name = "District of Columbia",
type = "scatter", mode = "lines") %>% add_trace(data = filter(realtor_sqft, name ==
"Florida"), x = ~dates, y = ~data, opacity = 0.3, name = "Florida", type = "scatter",
mode = "lines") %>% add_trace(data = filter(realtor_sqft, name == "Georgia"),
x = ~dates, y = ~data, opacity = 0.3, name = "Georgia", type = "scatter", mode = "lines",
visible = "legendonly") %>% add_trace(data = filter(realtor_sqft, name == "Idaho"),
x = ~dates, y = ~data, opacity = 0.3, name = "Idaho", type = "scatter", mode = "lines",
visible = "legendonly") %>% add_trace(data = filter(realtor_sqft, name == "Illinois"),
x = ~dates, y = ~data, opacity = 0.3, name = "Illinois", type = "scatter", mode = "lines",
visible = "legendonly") %>% add_trace(data = filter(realtor_sqft, name == "Indiana"),
x = ~dates, y = ~data, opacity = 0.3, name = "Indiana", type = "scatter", mode = "lines",
visible = "legendonly") %>% add_trace(data = filter(realtor_sqft, name == "Iowa"),
x = ~dates, y = ~data, opacity = 0.3, name = "Iowa", type = "scatter", mode = "lines",
visible = "legendonly") %>% add_trace(data = filter(realtor_sqft, name == "Kansas"),
x = ~dates, y = ~data, opacity = 0.3, name = "Kansas", type = "scatter", mode = "lines",
visible = "legendonly") %>% add_trace(data = filter(realtor_sqft, name == "Kentucky"),
x = ~dates, y = ~data, opacity = 0.3, name = "Kentucky", type = "scatter", mode = "lines",
visible = "legendonly") %>% add_trace(data = filter(realtor_sqft, name == "Louisiana"),
x = ~dates, y = ~data, opacity = 0.3, name = "Louisiana", type = "scatter", mode = "lines",
visible = "legendonly") %>% add_trace(data = filter(realtor_sqft, name == "Maine"),
x = ~dates, y = ~data, opacity = 0.3, name = "Maine", type = "scatter", mode = "lines",
visible = "legendonly") %>% add_trace(data = filter(realtor_sqft, name == "Maryland"),
x = ~dates, y = ~data, opacity = 0.3, name = "Maryland", type = "scatter", mode = "lines",
visible = "legendonly") %>% add_trace(data = filter(realtor_sqft, name == "Massachusetts"),
x = ~dates, y = ~data, opacity = 0.3, name = "Massachusetts", type = "scatter",
mode = "lines") %>% add_trace(data = filter(realtor_sqft, name == "Michigan"),
x = ~dates, y = ~data, opacity = 0.3, name = "Michigan", type = "scatter", mode = "lines",
visible = "legendonly") %>% add_trace(data = filter(realtor_sqft, name == "Minnesota"),
x = ~dates, y = ~data, opacity = 0.3, name = "Minnesota", type = "scatter", mode = "lines",
visible = "legendonly") %>% add_trace(data = filter(realtor_sqft, name == "Mississippi"),
x = ~dates, y = ~data, opacity = 0.3, name = "Mississippi", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_sqft,
name == "Missouri"), x = ~dates, y = ~data, opacity = 0.3, name = "Missouri",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_sqft,
name == "Montana"), x = ~dates, y = ~data, opacity = 0.3, name = "Montana", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_sqft,
name == "Nebraska"), x = ~dates, y = ~data, opacity = 0.3, name = "Nebraska",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_sqft,
name == "Nevada"), x = ~dates, y = ~data, opacity = 0.3, name = "Nevada", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_sqft,
name == "NewHampshire"), x = ~dates, y = ~data, opacity = 0.3, name = "New Hampshire",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_sqft,
name == "NewJersey"), x = ~dates, y = ~data, opacity = 0.3, name = "New Jersey",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_sqft,
name == "NewMexico"), x = ~dates, y = ~data, opacity = 0.3, name = "New Mexico",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_sqft,
name == "NewYork"), x = ~dates, y = ~data, opacity = 0.3, name = "New York",
type = "scatter", mode = "lines") %>% add_trace(data = filter(realtor_sqft, name ==
"NorthCarolina"), x = ~dates, y = ~data, opacity = 0.3, name = "North Carolina",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_sqft,
name == "NorthDakota"), x = ~dates, y = ~data, opacity = 0.3, name = "North Dakota",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_sqft,
name == "Ohio"), x = ~dates, y = ~data, opacity = 0.3, name = "Ohio", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_sqft,
name == "Oklahoma"), x = ~dates, y = ~data, opacity = 0.3, name = "Oklahoma",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_sqft,
name == "Oregon"), x = ~dates, y = ~data, opacity = 0.3, name = "Oregon", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_sqft,
name == "Pennsylvania"), x = ~dates, y = ~data, opacity = 0.3, name = "Pennsylvania",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_sqft,
name == "PuertoRico"), x = ~dates, y = ~data, opacity = 0.3, name = "Puerto Rico",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_sqft,
name == "RhodeIsland"), x = ~dates, y = ~data, opacity = 0.3, name = "Rhode Island",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_sqft,
name == "SouthCarolina"), x = ~dates, y = ~data, opacity = 0.3, name = "South Carolina",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_sqft,
name == "SouthDakota"), x = ~dates, y = ~data, opacity = 0.3, name = "South Dakota",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_sqft,
name == "Tennessee"), x = ~dates, y = ~data, opacity = 0.3, name = "Tennessee",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_sqft,
name == "Texas"), x = ~dates, y = ~data, opacity = 0.3, name = "Texas", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_sqft,
name == "Utah"), x = ~dates, y = ~data, opacity = 0.3, name = "Utah", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_sqft,
name == "Vermont"), x = ~dates, y = ~data, opacity = 0.3, name = "Vermont", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_sqft,
name == "Virginia"), x = ~dates, y = ~data, opacity = 0.3, name = "Virginia",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_sqft,
name == "Washington"), x = ~dates, y = ~data, opacity = 0.3, name = "Washington",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_sqft,
name == "WestVirginia"), x = ~dates, y = ~data, opacity = 0.3, name = "West Virginia",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_sqft,
name == "Wisconsin"), x = ~dates, y = ~data, opacity = 0.3, name = "Wisconsin",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_sqft,
name == "Wyoming"), x = ~dates, y = ~data, opacity = 0.3, name = "Wyoming", type = "scatter",
mode = "lines", visible = "legendonly") %>% layout(title = "Median Square Feet of Listings (07/2016-11/2020)",
xaxis = list(title = "Month", titlefont = f1, showticklabels = TRUE, tickfont = f2,
exponentformat = "E"), yaxis = list(title = "Square Feet", titlefont = f1,
showticklabels = TRUE, tickfont = f2), margin = list(l = 80, r = 80, b = 100,
t = 100, pad = 4))
Generally, there has been a gradual decline in the square feet of listings presumably due to gradual densification and urbanization.
States with higher density show a noticeable decline in square footage of listings during the pandemic, implying owners of smaller units (i.e., apartment owners) are selling. This is less noticeable in states that are less dense/have more urban sprawl (e.g., California, Florida, Hawaii). In 2020, there is a general downward trend in the median square feet of listings coupled with a general upward trend in the median price per square feet. In other words, space is harder to find on the market, and the price of space is going up.
Active and New Listings
realtor_listings <- realtor_stats %>% mutate(name = name %>% str_remove("_UnitedStates")) %>%
filter(value_id %in% c("Realtor_ActiveListingCount", "Realtor_NewListingCount"),
missing == 0)
plot_ly(filter(realtor_listings, value_id == "Realtor_ActiveListingCount") %>% filter(name ==
"Hawaii"), x = ~dates, y = ~data, type = "scatter", mode = "lines", line = list(color = "rgb(0,100,170)"),
legendgroup = "Hawaii", name = "Hawaii - Active Listings") %>% add_trace(data = filter(realtor_listings,
name == "Hawaii") %>% filter(value_id == "Realtor_NewListingCount"), type = "scatter",
mode = "lines", line = list(color = "rgba(0,100,170,0.4)"), fill = "tonexty",
fillcolor = "rgba(0,100,170,0.2)", legendgroup = "Hawaii", name = "Hawaii - New Listings") %>%
add_trace(data = filter(realtor_listings, value_id == "Realtor_ActiveListingCount") %>%
filter(name == "Alabama"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(255,205,160)"), legendgroup = "Alabama", name = "Alabama - Active Listings",
visible = "legendonly") %>% add_trace(data = filter(realtor_listings, name ==
"Alabama") %>% filter(value_id == "Realtor_NewListingCount"), type = "scatter",
mode = "lines", line = list(color = "rgba(255,205,160,0.4)"), fill = "tonexty",
fillcolor = "rgba(255,205,160,0.2)", legendgroup = "Alabama", name = "Alabama - New Listings",
visible = "legendonly") %>%
add_trace(data = filter(realtor_listings, value_id == "Realtor_ActiveListingCount") %>%
filter(name == "Alaska"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(170,225,175)"), legendgroup = "Alaska", name = "Alaska - Active Listings",
visible = "legendonly") %>% add_trace(data = filter(realtor_listings, name ==
"Alaska") %>% filter(value_id == "Realtor_NewListingCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(170,225,175,0.2)", line = list(color = "rgba(170,225,175,0.4)"),
legendgroup = "Alaska", name = "Alaska - New Listings", visible = "legendonly") %>%
add_trace(data = filter(realtor_listings, value_id == "Realtor_ActiveListingCount") %>%
filter(name == "Arizona"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(250,170,175)"), legendgroup = "Arizona", name = "Arizona - Active Listings",
visible = "legendonly") %>% add_trace(data = filter(realtor_listings, name ==
"Arizona") %>% filter(value_id == "Realtor_NewListingCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(250,170,175,0.2)", line = list(color = "rgba(250,170,175,0.4)"),
legendgroup = "Arizona", name = "Arizona - New Listings", visible = "legendonly") %>%
add_trace(data = filter(realtor_listings, value_id == "Realtor_ActiveListingCount") %>%
filter(name == "Arkansas"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(220,195,235)"), legendgroup = "Arkansas", name = "Arkansas - Active Listings",
visible = "legendonly") %>% add_trace(data = filter(realtor_listings, name ==
"Arkansas") %>% filter(value_id == "Realtor_NewListingCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(220,195,235,0.2)", line = list(color = "rgba(220,195,235,0.4)"),
legendgroup = "Arkansas", name = "Arkansas - New Listings", visible = "legendonly") %>%
add_trace(data = filter(realtor_listings, value_id == "Realtor_ActiveListingCount") %>%
filter(name == "California"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(215,190,190)"), legendgroup = "California", name = "California - Active Listings",
visible = "legendonly") %>% add_trace(data = filter(realtor_listings, name ==
"California") %>% filter(value_id == "Realtor_NewListingCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(215,190,190,0.2)", line = list(color = "rgba(215,190,190,0.4)"),
legendgroup = "California", name = "California - New Listings", visible = "legendonly") %>%
add_trace(data = filter(realtor_listings, value_id == "Realtor_ActiveListingCount") %>%
filter(name == "Colorado"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(250,200,235)"), legendgroup = "Colorado", name = "Colorado - Active Listings",
visible = "legendonly") %>% add_trace(data = filter(realtor_listings, name ==
"Colorado") %>% filter(value_id == "Realtor_NewListingCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(250,200,235,0.2)", line = list(color = "rgba(250,200,235,0.4)"),
legendgroup = "Colorado", name = "Colorado - New Listings", visible = "legendonly") %>%
add_trace(data = filter(realtor_listings, value_id == "Realtor_ActiveListingCount") %>%
filter(name == "Connecticut"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(210,210,210)"), legendgroup = "Connecticut", name = "Connecticut - Active Listings",
visible = "legendonly") %>% add_trace(data = filter(realtor_listings, name ==
"Connecticut") %>% filter(value_id == "Realtor_NewListingCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(210,210,210,0.2)", line = list(color = "rgba(210,210,210,0.4)"),
legendgroup = "Connecticut", name = "Connecticut - New Listings", visible = "legendonly") %>%
add_trace(data = filter(realtor_listings, value_id == "Realtor_ActiveListingCount") %>%
filter(name == "Delaware"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(230,230,170)"), legendgroup = "Delaware", name = "Delaware - Active Listings",
visible = "legendonly") %>% add_trace(data = filter(realtor_listings, name ==
"Delaware") %>% filter(value_id == "Realtor_NewListingCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(230,230,170,0.2)", line = list(color = "rgba(230,230,170,0.4)"),
legendgroup = "Delaware", name = "Delaware - New Listings", visible = "legendonly") %>%
add_trace(data = filter(realtor_listings, value_id == "Realtor_ActiveListingCount") %>%
filter(name == "DistrictofColumbia"), x = ~dates, y = ~data, type = "scatter",
mode = "lines", line = list(color = "rgb(160,235,240)"), legendgroup = "DistrictofColumbia",
name = "District of Columbia - Active Listings", visible = "legendonly") %>%
add_trace(data = filter(realtor_listings, name == "DistrictofColumbia") %>% filter(value_id ==
"Realtor_NewListingCount"), type = "scatter", mode = "lines", fill = "tonexty",
fillcolor = "rgba(160,235,240,0.2)", line = list(color = "rgba(160,235,240,0.4)"),
legendgroup = "DistrictofColumbia", name = "District of Columbia - New Listings",
visible = "legendonly") %>% add_trace(data = filter(realtor_listings, value_id ==
"Realtor_ActiveListingCount") %>% filter(name == "Florida"), x = ~dates, y = ~data,
type = "scatter", mode = "lines", line = list(color = "rgb(170,205,230)"), legendgroup = "Florida",
name = "Florida - Active Listings", visible = "legendonly") %>% add_trace(data = filter(realtor_listings,
name == "Florida") %>% filter(value_id == "Realtor_NewListingCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(170,205,230,0.2)", line = list(color = "rgba(170,205,230,0.4)"),
legendgroup = "Florida", name = "Florida - New Listings", visible = "legendonly") %>%
add_trace(data = filter(realtor_listings, value_id == "Realtor_ActiveListingCount") %>%
filter(name == "Georgia"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(255,205,160)"), legendgroup = "Georgia", name = "Georgia - Active Listings",
visible = "legendonly") %>% add_trace(data = filter(realtor_listings, name ==
"Georgia") %>% filter(value_id == "Realtor_NewListingCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(255,205,160,0.2)", line = list(color = "rgba(255,205,160,0.4)"),
legendgroup = "Georgia", name = "Georgia - New Listings", visible = "legendonly") %>%
add_trace(data = filter(realtor_listings, value_id == "Realtor_ActiveListingCount") %>%
filter(name == "Idaho"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(170,225,175)"), legendgroup = "Idaho", name = "Idaho - Active Listings",
visible = "legendonly") %>% add_trace(data = filter(realtor_listings, name ==
"Idaho") %>% filter(value_id == "Realtor_NewListingCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(170,225,175,0.2)", line = list(color = "rgba(170,225,175,0.4)"),
legendgroup = "Idaho", name = "Idaho - New Listings", visible = "legendonly") %>%
add_trace(data = filter(realtor_listings, value_id == "Realtor_ActiveListingCount") %>%
filter(name == "Illinois"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(250,175,180"), legendgroup = "Illinois", name = "Illinois - Active Listings",
visible = "legendonly") %>% add_trace(data = filter(realtor_listings, name ==
"Illinois") %>% filter(value_id == "Realtor_NewListingCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(250,175,180,0.2)", line = list(color = "rgba(250,175,180,0.4"),
legendgroup = "Illinois", name = "Illinois - New Listings", visible = "legendonly") %>%
add_trace(data = filter(realtor_listings, value_id == "Realtor_ActiveListingCount") %>%
filter(name == "Indiana"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(220,195,235)"), legendgroup = "Indiana", name = "Indiana - Active Listings",
visible = "legendonly") %>% add_trace(data = filter(realtor_listings, name ==
"Indiana") %>% filter(value_id == "Realtor_NewListingCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(220,195,235,0.2)", line = list(color = "rgba(220,195,235,0.4)"),
legendgroup = "Indiana", name = "Indiana - New Listings", visible = "legendonly") %>%
add_trace(data = filter(realtor_listings, value_id == "Realtor_ActiveListingCount") %>%
filter(name == "Iowa"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(215,190,190)"), legendgroup = "Iowa", name = "Iowa - Active Listings",
visible = "legendonly") %>% add_trace(data = filter(realtor_listings, name ==
"Iowa") %>% filter(value_id == "Realtor_NewListingCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(215,190,190,0.2)", line = list(color = "rgba(215,190,190,0.4)"),
legendgroup = "Iowa", name = "Iowa - New Listings", visible = "legendonly") %>%
add_trace(data = filter(realtor_listings, value_id == "Realtor_ActiveListingCount") %>%
filter(name == "Kansas"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(250,200,235)"), legendgroup = "Kansas", name = "Kansas - Active Listings",
visible = "legendonly") %>% add_trace(data = filter(realtor_listings, name ==
"Kansas") %>% filter(value_id == "Realtor_NewListingCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(250,200,235,0.2)", line = list(color = "rgba(250,200,235,0.4)"),
legendgroup = "Kansas", name = "Kansas - New Listings", visible = "legendonly") %>%
add_trace(data = filter(realtor_listings, value_id == "Realtor_ActiveListingCount") %>%
filter(name == "Kentucky"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(210,210,210)"), legendgroup = "Kentucky", name = "Kentucky - Active Listings",
visible = "legendonly") %>% add_trace(data = filter(realtor_listings, name ==
"Kentucky") %>% filter(value_id == "Realtor_NewListingCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(210,210,210,0.2)", line = list(color = "rgba(210,210,210,0.4)"),
legendgroup = "Kentucky", name = "Kentucky - New Listings", visible = "legendonly") %>%
add_trace(data = filter(realtor_listings, value_id == "Realtor_ActiveListingCount") %>%
filter(name == "Louisiana"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(230,235,170)"), legendgroup = "Louisiana", name = "Louisiana - Active Listings",
visible = "legendonly") %>% add_trace(data = filter(realtor_listings, name ==
"Louisiana") %>% filter(value_id == "Realtor_NewListingCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(230,235,170,0.2)", line = list(color = "rgba(230,235,170,0.4)"),
legendgroup = "Louisiana", name = "Louisiana - New Listings", visible = "legendonly") %>%
add_trace(data = filter(realtor_listings, value_id == "Realtor_ActiveListingCount") %>%
filter(name == "Maine"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(160,235,240)"), legendgroup = "Maine", name = "Maine - Active Listings",
visible = "legendonly") %>% add_trace(data = filter(realtor_listings, name ==
"Maine") %>% filter(value_id == "Realtor_NewListingCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(160,235,240,0.2)", line = list(color = "rgba(160,235,240,0.4)"),
legendgroup = "Maine", name = "Maine - New Listings", visible = "legendonly") %>%
add_trace(data = filter(realtor_listings, value_id == "Realtor_ActiveListingCount") %>%
filter(name == "Maryland"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(170,205,230)"), legendgroup = "Maryland", name = "Maryland - Active Listings",
visible = "legendonly") %>% add_trace(data = filter(realtor_listings, name ==
"Maryland") %>% filter(value_id == "Realtor_NewListingCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(170,205,230,0.2)", line = list(color = "rgba(170,205,230,0.4)"),
legendgroup = "Maryland", name = "Maryland - New Listings", visible = "legendonly") %>%
add_trace(data = filter(realtor_listings, value_id == "Realtor_ActiveListingCount") %>%
filter(name == "Massachusetts"), x = ~dates, y = ~data, type = "scatter",
mode = "lines", line = list(color = "rgb(255,205,160)"), legendgroup = "Massachusetts",
name = "Massachusetts - Active Listings", visible = "legendonly") %>% add_trace(data = filter(realtor_listings,
name == "Massachusetts") %>% filter(value_id == "Realtor_NewListingCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(255,205,160,0.2)", line = list(color = "rgba(255,205,160,0.4)"),
legendgroup = "Massachusetts", name = "Massachusetts - New Listings", visible = "legendonly") %>%
add_trace(data = filter(realtor_listings, value_id == "Realtor_ActiveListingCount") %>%
filter(name == "Michigan"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(170,225,175)"), legendgroup = "Michigan", name = "Michigan - Active Listings",
visible = "legendonly") %>% add_trace(data = filter(realtor_listings, name ==
"Michigan") %>% filter(value_id == "Realtor_NewListingCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(170,225,175,0.2)", line = list(color = "rgba(170,225,175,0.4)"),
legendgroup = "Michigan", name = "Michigan - New Listings", visible = "legendonly") %>%
add_trace(data = filter(realtor_listings, value_id == "Realtor_ActiveListingCount") %>%
filter(name == "Minnesota"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(250,170,175)"), legendgroup = "Minnesota", name = "Minnesota - Active Listings",
visible = "legendonly") %>% add_trace(data = filter(realtor_listings, name ==
"Minnesota") %>% filter(value_id == "Realtor_NewListingCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(250,170,175,0.2)", line = list(color = "rgba(250,170,175,0.4)"),
legendgroup = "Minnesota", name = "Minnesota - New Listings", visible = "legendonly") %>%
add_trace(data = filter(realtor_listings, value_id == "Realtor_ActiveListingCount") %>%
filter(name == "Mississippi"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(220,195,235)"), legendgroup = "Mississippi", name = "Mississippi - Active Listings",
visible = "legendonly") %>% add_trace(data = filter(realtor_listings, name ==
"Mississippi") %>% filter(value_id == "Realtor_NewListingCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(220,195,235,0.2)", line = list(color = "rgba(220,195,235,0.4)"),
legendgroup = "Mississippi", name = "Mississippi - New Listings", visible = "legendonly") %>%
add_trace(data = filter(realtor_listings, value_id == "Realtor_ActiveListingCount") %>%
filter(name == "Missouri"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(215,190,190)"), legendgroup = "Missouri", name = "Missouri - Active Listings",
visible = "legendonly") %>% add_trace(data = filter(realtor_listings, name ==
"Missouri") %>% filter(value_id == "Realtor_NewListingCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(215,190,190,0.2)", line = list(color = "rgba(215,190,190,0.4)"),
legendgroup = "Missouri", name = "Missouri - New Listings", visible = "legendonly") %>%
add_trace(data = filter(realtor_listings, value_id == "Realtor_ActiveListingCount") %>%
filter(name == "Montana"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(250,200,235)"), legendgroup = "Montana", name = "Montana - Active Listings",
visible = "legendonly") %>% add_trace(data = filter(realtor_listings, name ==
"Montana") %>% filter(value_id == "Realtor_NewListingCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(250,200,235,0.2)", line = list(color = "rgba(250,200,235,0.4)"),
legendgroup = "Montana", name = "Montana - New Listings", visible = "legendonly") %>%
add_trace(data = filter(realtor_listings, value_id == "Realtor_ActiveListingCount") %>%
filter(name == "Nebraska"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(210,210,210)"), legendgroup = "Nebraska", name = "Nebraska - Active Listings",
visible = "legendonly") %>% add_trace(data = filter(realtor_listings, name ==
"Nebraska") %>% filter(value_id == "Realtor_NewListingCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(210,210,210,0.2)", line = list(color = "rgba(210,210,210,0.4)"),
legendgroup = "Nebraska", name = "Nebraska - New Listings", visible = "legendonly") %>%
add_trace(data = filter(realtor_listings, value_id == "Realtor_ActiveListingCount") %>%
filter(name == "Nevada"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(230,235,170)"), legendgroup = "Nevada", name = "Nevada - Active Listings",
visible = "legendonly") %>% add_trace(data = filter(realtor_listings, name ==
"Nevada") %>% filter(value_id == "Realtor_NewListingCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(230,235,170,0.2)", line = list(color = "rgba(230,235,170,0.4)"),
legendgroup = "Nevada", name = "Nevada - New Listings", visible = "legendonly") %>%
add_trace(data = filter(realtor_listings, value_id == "Realtor_ActiveListingCount") %>%
filter(name == "NewHampshire"), x = ~dates, y = ~data, type = "scatter",
mode = "lines", line = list(color = "rgb(160,235,240)"), legendgroup = "NewHampshire",
name = "New Hampshire - Active Listings", visible = "legendonly") %>% add_trace(data = filter(realtor_listings,
name == "NewHampshire") %>% filter(value_id == "Realtor_NewListingCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(160,235,240,0.2)", line = list(color = "rgba(160,235,240,0.4)"),
legendgroup = "NewHampshire", name = "New Hampshire - New Listings", visible = "legendonly") %>%
add_trace(data = filter(realtor_listings, value_id == "Realtor_ActiveListingCount") %>%
filter(name == "NewJersey"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(170,205,230)"), legendgroup = "NewJersey", name = "New Jersey - Active Listings",
visible = "legendonly") %>% add_trace(data = filter(realtor_listings, name ==
"NewJersey") %>% filter(value_id == "Realtor_NewListingCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(170,205,230,0.2)", line = list(color = "rgba(170,205,230,0.4)"),
legendgroup = "NewJersey", name = "New Jersey - New Listings", visible = "legendonly") %>%
add_trace(data = filter(realtor_listings, value_id == "Realtor_ActiveListingCount") %>%
filter(name == "NewMexico"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(255,205,160)"), legendgroup = "NewMexico", name = "New Mexico - Active Listings",
visible = "legendonly") %>% add_trace(data = filter(realtor_listings, name ==
"NewMexico") %>% filter(value_id == "Realtor_NewListingCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(255,205,160,0.2)", line = list(color = "rgba(255,205,160,0.4)"),
legendgroup = "NewMexico", name = "New Mexico - New Listings", visible = "legendonly") %>%
add_trace(data = filter(realtor_listings, value_id == "Realtor_ActiveListingCount") %>%
filter(name == "NewYork"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(170,225,175)"), legendgroup = "NewYork", name = "New York - Active Listings",
visible = "legendonly") %>% add_trace(data = filter(realtor_listings, name ==
"NewYork") %>% filter(value_id == "Realtor_NewListingCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(170,225,175,0.2)", line = list(color = "rgba(170,225,175,0.4)"),
legendgroup = "NewYork", name = "New York - New Listings", visible = "legendonly") %>%
add_trace(data = filter(realtor_listings, value_id == "Realtor_ActiveListingCount") %>%
filter(name == "NorthCarolina"), x = ~dates, y = ~data, type = "scatter",
mode = "lines", line = list(color = "rgb(250,170,175)"), legendgroup = "NorthCarolina",
name = "North Carolina - Active Listings", visible = "legendonly") %>% add_trace(data = filter(realtor_listings,
name == "NorthCarolina") %>% filter(value_id == "Realtor_NewListingCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(250,170,175,0.2)", line = list(color = "rgba(250,170,175,0.4)"),
legendgroup = "NorthCarolina", name = "North Carolina - New Listings", visible = "legendonly") %>%
add_trace(data = filter(realtor_listings, value_id == "Realtor_ActiveListingCount") %>%
filter(name == "NorthDakota"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(220,195,235)"), legendgroup = "NorthDakota", name = "North Dakota - Active Listings",
visible = "legendonly") %>% add_trace(data = filter(realtor_listings, name ==
"NorthDakota") %>% filter(value_id == "Realtor_NewListingCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(220,195,235,0.2)", line = list(color = "rgba(220,195,235,0.4)"),
legendgroup = "NorthDakota", name = "North Dakota - New Listings", visible = "legendonly") %>%
add_trace(data = filter(realtor_listings, value_id == "Realtor_ActiveListingCount") %>%
filter(name == "Ohio"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(215,190,190)"), legendgroup = "Ohio", name = "Ohio - Active Listings",
visible = "legendonly") %>% add_trace(data = filter(realtor_listings, name ==
"Ohio") %>% filter(value_id == "Realtor_NewListingCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(215,190,190,0.2)", line = list(color = "rgba(215,190,190,0.4)"),
legendgroup = "Ohio", name = "Ohio - New Listings", visible = "legendonly") %>%
add_trace(data = filter(realtor_listings, value_id == "Realtor_ActiveListingCount") %>%
filter(name == "Oklahoma"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(250,200,235)"), legendgroup = "Oklahoma", name = "Oklahoma - Active Listings",
visible = "legendonly") %>% add_trace(data = filter(realtor_listings, name ==
"Oklahoma") %>% filter(value_id == "Realtor_NewListingCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(250,200,235,0.2)", line = list(color = "rgba(250,200,235,0.4)"),
legendgroup = "Oklahoma", name = "Oklahoma - New Listings", visible = "legendonly") %>%
add_trace(data = filter(realtor_listings, value_id == "Realtor_ActiveListingCount") %>%
filter(name == "Oregon"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(210,210,210)"), legendgroup = "Oregon", name = "Oregon - Active Listings",
visible = "legendonly") %>% add_trace(data = filter(realtor_listings, name ==
"Oregon") %>% filter(value_id == "Realtor_NewListingCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(210,210,210,0.2)", line = list(color = "rgba(210,210,210,0.4)"),
legendgroup = "Oregon", name = "Oregon - New Listings", visible = "legendonly") %>%
add_trace(data = filter(realtor_listings, value_id == "Realtor_ActiveListingCount") %>%
filter(name == "Pennsylvania"), x = ~dates, y = ~data, type = "scatter",
mode = "lines", line = list(color = "rgb(230,235,170)"), legendgroup = "Pennsylvania",
name = "Pennsylvania - Active Listings", visible = "legendonly") %>% add_trace(data = filter(realtor_listings,
name == "Pennsylvania") %>% filter(value_id == "Realtor_NewListingCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(230,235,170,0.2)", line = list(color = "rgba(230,235,170,0.4)"),
legendgroup = "Pennsylvania", name = "Pennsylvania - New Listings", visible = "legendonly") %>%
add_trace(data = filter(realtor_listings, value_id == "Realtor_ActiveListingCount") %>%
filter(name == "PuertoRico"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(160,235,240)"), legendgroup = "PuertoRico", name = "Puerto Rico - Active Listings",
visible = "legendonly") %>% add_trace(data = filter(realtor_listings, name ==
"PuertoRico") %>% filter(value_id == "Realtor_NewListingCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(160,235,240,0.2)", line = list(color = "rgba(160,235,240,0.4)"),
legendgroup = "PuertoRico", name = "Puerto Rico - New Listings", visible = "legendonly") %>%
add_trace(data = filter(realtor_listings, value_id == "Realtor_ActiveListingCount") %>%
filter(name == "RhodeIsland"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(170,205,230)"), legendgroup = "RhodeIsland", name = "Rhode Island - Active Listings",
visible = "legendonly") %>% add_trace(data = filter(realtor_listings, name ==
"RhodeIsland") %>% filter(value_id == "Realtor_NewListingCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(170,205,230,0.2)", line = list(color = "rgba(170,205,230,0.4)"),
legendgroup = "RhodeIsland", name = "Rhode Island - New Listings", visible = "legendonly") %>%
add_trace(data = filter(realtor_listings, value_id == "Realtor_ActiveListingCount") %>%
filter(name == "SouthCarolina"), x = ~dates, y = ~data, type = "scatter",
mode = "lines", line = list(color = "rgb(255,205,160)"), legendgroup = "SouthCarolina",
name = "South Carolina - Active Listings", visible = "legendonly") %>% add_trace(data = filter(realtor_listings,
name == "SouthCarolina") %>% filter(value_id == "Realtor_NewListingCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(255,205,160,0.2)", line = list(color = "rgba(255,205,160,0.4)"),
legendgroup = "SouthCarolina", name = "South Carolina - New Listings", visible = "legendonly") %>%
add_trace(data = filter(realtor_listings, value_id == "Realtor_ActiveListingCount") %>%
filter(name == "SouthDakota"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(170,225,175)"), legendgroup = "SouthDakota", name = "South Dakota - Active Listings",
visible = "legendonly") %>% add_trace(data = filter(realtor_listings, name ==
"SouthDakota") %>% filter(value_id == "Realtor_NewListingCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(170,225,175,0.2)", line = list(color = "rgba(170,225,175,0.4)"),
legendgroup = "SouthDakota", name = "South Dakota - New Listings", visible = "legendonly") %>%
add_trace(data = filter(realtor_listings, value_id == "Realtor_ActiveListingCount") %>%
filter(name == "Tennessee"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(250,170,175)"), legendgroup = "Tennessee", name = "Tennessee - Active Listings",
visible = "legendonly") %>% add_trace(data = filter(realtor_listings, name ==
"Tennessee") %>% filter(value_id == "Realtor_NewListingCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(250,170,175,0.2)", line = list(color = "rgba(250,170,175,0.4)"),
legendgroup = "Tennessee", name = "Tennessee - New Listings", visible = "legendonly") %>%
add_trace(data = filter(realtor_listings, value_id == "Realtor_ActiveListingCount") %>%
filter(name == "Texas"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(220,195,235)"), legendgroup = "Texas", name = "Texas - Active Listings",
visible = "legendonly") %>% add_trace(data = filter(realtor_listings, name ==
"Texas") %>% filter(value_id == "Realtor_NewListingCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(220,195,235,0.2)", line = list(color = "rgba(220,195,235,0.4)"),
legendgroup = "Texas", name = "Texas - New Listings", visible = "legendonly") %>%
add_trace(data = filter(realtor_listings, value_id == "Realtor_ActiveListingCount") %>%
filter(name == "Utah"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(215,190,190)"), legendgroup = "Utah", name = "Utah - Active Listings",
visible = "legendonly") %>% add_trace(data = filter(realtor_listings, name ==
"Utah") %>% filter(value_id == "Realtor_NewListingCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(215,190,190,0.2)", line = list(color = "rgba(215,190,190,0.4)"),
legendgroup = "Utah", name = "Utah - New Listings", visible = "legendonly") %>%
add_trace(data = filter(realtor_listings, value_id == "Realtor_ActiveListingCount") %>%
filter(name == "Vermont"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(250,200,235)"), legendgroup = "Vermont", name = "Vermont - Active Listings",
visible = "legendonly") %>% add_trace(data = filter(realtor_listings, name ==
"Vermont") %>% filter(value_id == "Realtor_NewListingCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(250,200,235,0.2)", line = list(color = "rgba(250,200,235,0.4)"),
legendgroup = "Vermont", name = "Vermont - New Listings", visible = "legendonly") %>%
add_trace(data = filter(realtor_listings, value_id == "Realtor_ActiveListingCount") %>%
filter(name == "Virginia"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(210,210,210)"), legendgroup = "Virginia", name = "Virginia - Active Listings",
visible = "legendonly") %>% add_trace(data = filter(realtor_listings, name ==
"Virginia") %>% filter(value_id == "Realtor_NewListingCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(210,210,210,0.2)", line = list(color = "rgba(210,210,210,0.4)"),
legendgroup = "Virginia", name = "Virginia - New Listings", visible = "legendonly") %>%
add_trace(data = filter(realtor_listings, value_id == "Realtor_ActiveListingCount") %>%
filter(name == "Washington"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(230,235,170)"), legendgroup = "Washington", name = "Washington - Active Listings",
visible = "legendonly") %>% add_trace(data = filter(realtor_listings, name ==
"Washington") %>% filter(value_id == "Realtor_NewListingCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(230,235,170,0.2)", line = list(color = "rgba(230,235,170,0.4)"),
legendgroup = "Washington", name = "Washington - New Listings", visible = "legendonly") %>%
add_trace(data = filter(realtor_listings, value_id == "Realtor_ActiveListingCount") %>%
filter(name == "WestVirginia"), x = ~dates, y = ~data, type = "scatter",
mode = "lines", line = list(color = "rgb(160,235,240)"), legendgroup = "WestVirginia",
name = "West Virginia - Active Listings", visible = "legendonly") %>% add_trace(data = filter(realtor_listings,
name == "WestVirginia") %>% filter(value_id == "Realtor_NewListingCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(160,235,240,0.2)", line = list(color = "rgba(160,235,240,0.4)"),
legendgroup = "WestVirginia", name = "West Virginia - New Listings", visible = "legendonly") %>%
add_trace(data = filter(realtor_listings, value_id == "Realtor_ActiveListingCount") %>%
filter(name == "Wisconsin"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(170,205,230)"), legendgroup = "Wisconsin", name = "Wisconsin - Active Listings",
visible = "legendonly") %>% add_trace(data = filter(realtor_listings, name ==
"Wisconsin") %>% filter(value_id == "Realtor_NewListingCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(170,205,230,0.2)", line = list(color = "rgba(170,205,230,0.4)"),
legendgroup = "Wisconsin", name = "Wisconsin - New Listings", visible = "legendonly") %>%
add_trace(data = filter(realtor_listings, value_id == "Realtor_ActiveListingCount") %>%
filter(name == "Wyoming"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(255,210,165)"), legendgroup = "Wyoming", name = "Wyoming - Active Listings",
visible = "legendonly") %>% add_trace(data = filter(realtor_listings, name ==
"Wyoming") %>% filter(value_id == "Realtor_NewListingCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(255,210,165,0.2)", line = list(color = "rgba(255,210,165,0.4)"),
legendgroup = "Wyoming", name = "Wyoming - New Listings", visible = "legendonly") %>%
layout(title = "Number of Active and New Listings (07/2016-11/2020)", paper_bgcolor = "rgb(200,200,200)",
plot_bgcolor = "rgb(150,150,150)", xaxis = list(title = "Month", gridcolor = "rgb(255,255,255)",
showgrid = TRUE, showline = FALSE, showticklabels = TRUE, tickcolor = "rgb(127,127,127)",
ticks = "outside", zeroline = FALSE), yaxis = list(title = "Listings",
gridcolor = "rgb(255,255,255)", showgrid = TRUE, showline = FALSE, showticklabels = TRUE,
tickcolor = "rgb(127,127,127)", ticks = "outside", zeroline = FALSE),
margin = list(l = 80, r = 80, b = 75, t = 100, pad = 4))
Before April 2020 (except for the second half of 2018), there was a steadily declining number of active listings paired with a relatively constant level of new listings, which suggests that demand is buying up real estate faster than the stock can be replenished.
After May 2020, Hawaii seems to be one of the few states (perhaps the only state) with a boost in active listings. This is not caused by an increase in new listings (which remains relatively steady). As such, we may infer that the sharp increase in active listings (which take the reverse ladle shape of the average listing price drop starting in January) is due to decreased demand that isn’t buying enough of the stock to keep it level or declining.
As a side note: Hawaii seems to be the only state that does not follow a seasonal pattern in the posting of listings (i.e., peak in new and active listings in the summer, bottom in December).
Price Increases and Decreases
realtor_priceincdec <- realtor_stats %>% mutate(name = name %>% str_remove("_UnitedStates")) %>%
filter(value_id %in% c("Realtor_PriceIncreasedCount", "Realtor_PriceReducedCount"),
missing == 0)
plot_ly(filter(realtor_priceincdec, value_id == "Realtor_PriceIncreasedCount") %>%
filter(name == "Hawaii"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(0,100,170)"), legendgroup = "Hawaii", name = "Hawaii - Price Increases") %>%
add_trace(data = filter(realtor_priceincdec, name == "Hawaii") %>% filter(value_id ==
"Realtor_PriceReducedCount"), type = "scatter", mode = "lines", line = list(color = "rgba(0,100,170,0.4)"),
fill = "tonexty", fillcolor = "rgba(0,100,170,0.2)", legendgroup = "Hawaii",
name = "Hawaii - Price Reductions") %>% add_trace(data = filter(realtor_priceincdec,
value_id == "Realtor_PriceIncreasedCount") %>% filter(name == "Alabama"), x = ~dates,
y = ~data, type = "scatter", mode = "lines", line = list(color = "rgb(255,205,160)"),
legendgroup = "Alabama", name = "Alabama - Price Increases", visible = "legendonly") %>%
add_trace(data = filter(realtor_priceincdec, name == "Alabama") %>% filter(value_id ==
"Realtor_PriceReducedCount"), type = "scatter", mode = "lines", line = list(color = "rgba(255,205,160,0.4)"),
fill = "tonexty", fillcolor = "rgba(255,205,160,0.2)", legendgroup = "Alabama",
name = "Alabama - Price Reductions", visible = "legendonly") %>%
add_trace(data = filter(realtor_priceincdec, value_id == "Realtor_PriceIncreasedCount") %>%
filter(name == "Alaska"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(170,225,175)"), legendgroup = "Alaska", name = "Alaska - Price Increases",
visible = "legendonly") %>% add_trace(data = filter(realtor_priceincdec, name ==
"Alaska") %>% filter(value_id == "Realtor_PriceReducedCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(170,225,175,0.2)", line = list(color = "rgba(170,225,175,0.4)"),
legendgroup = "Alaska", name = "Alaska - Price Reductions", visible = "legendonly") %>%
add_trace(data = filter(realtor_priceincdec, value_id == "Realtor_PriceIncreasedCount") %>%
filter(name == "Arizona"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(250,170,175)"), legendgroup = "Arizona", name = "Arizona - Price Increases",
visible = "legendonly") %>% add_trace(data = filter(realtor_priceincdec, name ==
"Arizona") %>% filter(value_id == "Realtor_PriceReducedCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(250,170,175,0.2)", line = list(color = "rgba(250,170,175,0.4)"),
legendgroup = "Arizona", name = "Arizona - Price Reductions", visible = "legendonly") %>%
add_trace(data = filter(realtor_priceincdec, value_id == "Realtor_PriceIncreasedCount") %>%
filter(name == "Arkansas"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(220,195,235)"), legendgroup = "Arkansas", name = "Arkansas - Price Increases",
visible = "legendonly") %>% add_trace(data = filter(realtor_priceincdec,
name == "Arkansas") %>% filter(value_id == "Realtor_PriceReducedCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(220,195,235,0.2)", line = list(color = "rgba(220,195,235,0.4)"),
legendgroup = "Arkansas", name = "Arkansas - Price Reductions", visible = "legendonly") %>%
add_trace(data = filter(realtor_priceincdec, value_id == "Realtor_PriceIncreasedCount") %>%
filter(name == "California"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(215,190,190)"), legendgroup = "California", name = "California - Price Increases",
visible = "legendonly") %>% add_trace(data = filter(realtor_priceincdec,
name == "California") %>% filter(value_id == "Realtor_PriceReducedCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(215,190,190,0.2)", line = list(color = "rgba(215,190,190,0.4)"),
legendgroup = "California", name = "California - Price Reductions", visible = "legendonly") %>%
add_trace(data = filter(realtor_priceincdec, value_id == "Realtor_PriceIncreasedCount") %>%
filter(name == "Colorado"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(250,200,235)"), legendgroup = "Colorado", name = "Colorado - Price Increases",
visible = "legendonly") %>% add_trace(data = filter(realtor_priceincdec,
name == "Colorado") %>% filter(value_id == "Realtor_PriceReducedCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(250,200,235,0.2)", line = list(color = "rgba(250,200,235,0.4)"),
legendgroup = "Colorado", name = "Colorado - Price Reductions", visible = "legendonly") %>%
add_trace(data = filter(realtor_priceincdec, value_id == "Realtor_PriceIncreasedCount") %>%
filter(name == "Connecticut"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(210,210,210)"), legendgroup = "Connecticut", name = "Connecticut - Price Increases",
visible = "legendonly") %>% add_trace(data = filter(realtor_priceincdec,
name == "Connecticut") %>% filter(value_id == "Realtor_PriceReducedCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(210,210,210,0.2)", line = list(color = "rgba(210,210,210,0.4)"),
legendgroup = "Connecticut", name = "Connecticut - Price Reductions", visible = "legendonly") %>%
add_trace(data = filter(realtor_priceincdec, value_id == "Realtor_PriceIncreasedCount") %>%
filter(name == "Delaware"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(230,230,170)"), legendgroup = "Delaware", name = "Delaware - Price Increases",
visible = "legendonly") %>% add_trace(data = filter(realtor_priceincdec,
name == "Delaware") %>% filter(value_id == "Realtor_PriceReducedCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(230,230,170,0.2)", line = list(color = "rgba(230,230,170,0.4)"),
legendgroup = "Delaware", name = "Delaware - Price Reductions", visible = "legendonly") %>%
add_trace(data = filter(realtor_priceincdec, value_id == "Realtor_PriceIncreasedCount") %>%
filter(name == "DistrictofColumbia"), x = ~dates, y = ~data, type = "scatter",
mode = "lines", line = list(color = "rgb(160,235,240)"), legendgroup = "DistrictofColumbia",
name = "District of Columbia - Price Increases", visible = "legendonly") %>%
add_trace(data = filter(realtor_priceincdec, name == "DistrictofColumbia") %>%
filter(value_id == "Realtor_PriceReducedCount"), type = "scatter", mode = "lines",
fill = "tonexty", fillcolor = "rgba(160,235,240,0.2)", line = list(color = "rgba(160,235,240,0.4)"),
legendgroup = "DistrictofColumbia", name = "District of Columbia - Price Reductions",
visible = "legendonly") %>% add_trace(data = filter(realtor_priceincdec,
value_id == "Realtor_PriceIncreasedCount") %>% filter(name == "Florida"), x = ~dates,
y = ~data, type = "scatter", mode = "lines", line = list(color = "rgb(170,205,230)"),
legendgroup = "Florida", name = "Florida - Price Increases", visible = "legendonly") %>%
add_trace(data = filter(realtor_priceincdec, name == "Florida") %>% filter(value_id ==
"Realtor_PriceReducedCount"), type = "scatter", mode = "lines", fill = "tonexty",
fillcolor = "rgba(170,205,230,0.2)", line = list(color = "rgba(170,205,230,0.4)"),
legendgroup = "Florida", name = "Florida - Price Reductions", visible = "legendonly") %>%
add_trace(data = filter(realtor_priceincdec, value_id == "Realtor_PriceIncreasedCount") %>%
filter(name == "Georgia"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(255,205,160)"), legendgroup = "Georgia", name = "Georgia - Price Increases",
visible = "legendonly") %>% add_trace(data = filter(realtor_priceincdec,
name == "Georgia") %>% filter(value_id == "Realtor_PriceReducedCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(255,205,160,0.2)", line = list(color = "rgba(255,205,160,0.4)"),
legendgroup = "Georgia", name = "Georgia - Price Reductions", visible = "legendonly") %>%
add_trace(data = filter(realtor_priceincdec, value_id == "Realtor_PriceIncreasedCount") %>%
filter(name == "Idaho"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(170,225,175)"), legendgroup = "Idaho", name = "Idaho - Price Increases",
visible = "legendonly") %>% add_trace(data = filter(realtor_priceincdec,
name == "Idaho") %>% filter(value_id == "Realtor_PriceReducedCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(170,225,175,0.2)", line = list(color = "rgba(170,225,175,0.4)"),
legendgroup = "Idaho", name = "Idaho - Price Reductions", visible = "legendonly") %>%
add_trace(data = filter(realtor_priceincdec, value_id == "Realtor_PriceIncreasedCount") %>%
filter(name == "Illinois"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(250,175,180"), legendgroup = "Illinois", name = "Illinois - Price Increases",
visible = "legendonly") %>% add_trace(data = filter(realtor_priceincdec,
name == "Illinois") %>% filter(value_id == "Realtor_PriceReducedCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(250,175,180,0.2)", line = list(color = "rgba(250,175,180,0.4"),
legendgroup = "Illinois", name = "Illinois - Price Reductions", visible = "legendonly") %>%
add_trace(data = filter(realtor_priceincdec, value_id == "Realtor_PriceIncreasedCount") %>%
filter(name == "Indiana"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(220,195,235)"), legendgroup = "Indiana", name = "Indiana - Price Increases",
visible = "legendonly") %>% add_trace(data = filter(realtor_priceincdec,
name == "Indiana") %>% filter(value_id == "Realtor_PriceReducedCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(220,195,235,0.2)", line = list(color = "rgba(220,195,235,0.4)"),
legendgroup = "Indiana", name = "Indiana - Price Reductions", visible = "legendonly") %>%
add_trace(data = filter(realtor_priceincdec, value_id == "Realtor_PriceIncreasedCount") %>%
filter(name == "Iowa"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(215,190,190)"), legendgroup = "Iowa", name = "Iowa - Price Increases",
visible = "legendonly") %>% add_trace(data = filter(realtor_priceincdec,
name == "Iowa") %>% filter(value_id == "Realtor_PriceReducedCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(215,190,190,0.2)", line = list(color = "rgba(215,190,190,0.4)"),
legendgroup = "Iowa", name = "Iowa - Price Reductions", visible = "legendonly") %>%
add_trace(data = filter(realtor_priceincdec, value_id == "Realtor_PriceIncreasedCount") %>%
filter(name == "Kansas"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(250,200,235)"), legendgroup = "Kansas", name = "Kansas - Price Increases",
visible = "legendonly") %>% add_trace(data = filter(realtor_priceincdec,
name == "Kansas") %>% filter(value_id == "Realtor_PriceReducedCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(250,200,235,0.2)", line = list(color = "rgba(250,200,235,0.4)"),
legendgroup = "Kansas", name = "Kansas - Price Reductions", visible = "legendonly") %>%
add_trace(data = filter(realtor_priceincdec, value_id == "Realtor_PriceIncreasedCount") %>%
filter(name == "Kentucky"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(210,210,210)"), legendgroup = "Kentucky", name = "Kentucky - Price Increases",
visible = "legendonly") %>% add_trace(data = filter(realtor_priceincdec,
name == "Kentucky") %>% filter(value_id == "Realtor_PriceReducedCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(210,210,210,0.2)", line = list(color = "rgba(210,210,210,0.4)"),
legendgroup = "Kentucky", name = "Kentucky - Price Reductions", visible = "legendonly") %>%
add_trace(data = filter(realtor_priceincdec, value_id == "Realtor_PriceIncreasedCount") %>%
filter(name == "Louisiana"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(230,235,170)"), legendgroup = "Louisiana", name = "Louisiana - Price Increases",
visible = "legendonly") %>% add_trace(data = filter(realtor_priceincdec,
name == "Louisiana") %>% filter(value_id == "Realtor_PriceReducedCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(230,235,170,0.2)", line = list(color = "rgba(230,235,170,0.4)"),
legendgroup = "Louisiana", name = "Louisiana - Price Reductions", visible = "legendonly") %>%
add_trace(data = filter(realtor_priceincdec, value_id == "Realtor_PriceIncreasedCount") %>%
filter(name == "Maine"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(160,235,240)"), legendgroup = "Maine", name = "Maine - Price Increases",
visible = "legendonly") %>% add_trace(data = filter(realtor_priceincdec,
name == "Maine") %>% filter(value_id == "Realtor_PriceReducedCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(160,235,240,0.2)", line = list(color = "rgba(160,235,240,0.4)"),
legendgroup = "Maine", name = "Maine - Price Reductions", visible = "legendonly") %>%
add_trace(data = filter(realtor_priceincdec, value_id == "Realtor_PriceIncreasedCount") %>%
filter(name == "Maryland"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(170,205,230)"), legendgroup = "Maryland", name = "Maryland - Price Increases",
visible = "legendonly") %>% add_trace(data = filter(realtor_priceincdec,
name == "Maryland") %>% filter(value_id == "Realtor_PriceReducedCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(170,205,230,0.2)", line = list(color = "rgba(170,205,230,0.4)"),
legendgroup = "Maryland", name = "Maryland - Price Reductions", visible = "legendonly") %>%
add_trace(data = filter(realtor_priceincdec, value_id == "Realtor_PriceIncreasedCount") %>%
filter(name == "Massachusetts"), x = ~dates, y = ~data, type = "scatter",
mode = "lines", line = list(color = "rgb(255,205,160)"), legendgroup = "Massachusetts",
name = "Massachusetts - Price Increases", visible = "legendonly") %>% add_trace(data = filter(realtor_priceincdec,
name == "Massachusetts") %>% filter(value_id == "Realtor_PriceReducedCount"),
type = "scatter", mode = "lines", fill = "tonexty", fillcolor = "rgba(255,205,160,0.2)",
line = list(color = "rgba(255,205,160,0.4)"), legendgroup = "Massachusetts",
name = "Massachusetts - Price Reductions", visible = "legendonly") %>% add_trace(data = filter(realtor_priceincdec,
value_id == "Realtor_PriceIncreasedCount") %>% filter(name == "Michigan"), x = ~dates,
y = ~data, type = "scatter", mode = "lines", line = list(color = "rgb(170,225,175)"),
legendgroup = "Michigan", name = "Michigan - Price Increases", visible = "legendonly") %>%
add_trace(data = filter(realtor_priceincdec, name == "Michigan") %>% filter(value_id ==
"Realtor_PriceReducedCount"), type = "scatter", mode = "lines", fill = "tonexty",
fillcolor = "rgba(170,225,175,0.2)", line = list(color = "rgba(170,225,175,0.4)"),
legendgroup = "Michigan", name = "Michigan - Price Reductions", visible = "legendonly") %>%
add_trace(data = filter(realtor_priceincdec, value_id == "Realtor_PriceIncreasedCount") %>%
filter(name == "Minnesota"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(250,170,175)"), legendgroup = "Minnesota", name = "Minnesota - Price Increases",
visible = "legendonly") %>% add_trace(data = filter(realtor_priceincdec,
name == "Minnesota") %>% filter(value_id == "Realtor_PriceReducedCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(250,170,175,0.2)", line = list(color = "rgba(250,170,175,0.4)"),
legendgroup = "Minnesota", name = "Minnesota - Price Reductions", visible = "legendonly") %>%
add_trace(data = filter(realtor_priceincdec, value_id == "Realtor_PriceIncreasedCount") %>%
filter(name == "Mississippi"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(220,195,235)"), legendgroup = "Mississippi", name = "Mississippi - Price Increases",
visible = "legendonly") %>% add_trace(data = filter(realtor_priceincdec,
name == "Mississippi") %>% filter(value_id == "Realtor_PriceReducedCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(220,195,235,0.2)", line = list(color = "rgba(220,195,235,0.4)"),
legendgroup = "Mississippi", name = "Mississippi - Price Reductions", visible = "legendonly") %>%
add_trace(data = filter(realtor_priceincdec, value_id == "Realtor_PriceIncreasedCount") %>%
filter(name == "Missouri"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(215,190,190)"), legendgroup = "Missouri", name = "Missouri - Price Increases",
visible = "legendonly") %>% add_trace(data = filter(realtor_priceincdec,
name == "Missouri") %>% filter(value_id == "Realtor_PriceReducedCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(215,190,190,0.2)", line = list(color = "rgba(215,190,190,0.4)"),
legendgroup = "Missouri", name = "Missouri - Price Reductions", visible = "legendonly") %>%
add_trace(data = filter(realtor_priceincdec, value_id == "Realtor_PriceIncreasedCount") %>%
filter(name == "Montana"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(250,200,235)"), legendgroup = "Montana", name = "Montana - Price Increases",
visible = "legendonly") %>% add_trace(data = filter(realtor_priceincdec,
name == "Montana") %>% filter(value_id == "Realtor_PriceReducedCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(250,200,235,0.2)", line = list(color = "rgba(250,200,235,0.4)"),
legendgroup = "Montana", name = "Montana - Price Reductions", visible = "legendonly") %>%
add_trace(data = filter(realtor_priceincdec, value_id == "Realtor_PriceIncreasedCount") %>%
filter(name == "Nebraska"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(210,210,210)"), legendgroup = "Nebraska", name = "Nebraska - Price Increases",
visible = "legendonly") %>% add_trace(data = filter(realtor_priceincdec,
name == "Nebraska") %>% filter(value_id == "Realtor_PriceReducedCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(210,210,210,0.2)", line = list(color = "rgba(210,210,210,0.4)"),
legendgroup = "Nebraska", name = "Nebraska - Price Reductions", visible = "legendonly") %>%
add_trace(data = filter(realtor_priceincdec, value_id == "Realtor_PriceIncreasedCount") %>%
filter(name == "Nevada"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(230,235,170)"), legendgroup = "Nevada", name = "Nevada - Price Increases",
visible = "legendonly") %>% add_trace(data = filter(realtor_priceincdec,
name == "Nevada") %>% filter(value_id == "Realtor_PriceReducedCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(230,235,170,0.2)", line = list(color = "rgba(230,235,170,0.4)"),
legendgroup = "Nevada", name = "Nevada - Price Reductions", visible = "legendonly") %>%
add_trace(data = filter(realtor_priceincdec, value_id == "Realtor_PriceIncreasedCount") %>%
filter(name == "NewHampshire"), x = ~dates, y = ~data, type = "scatter",
mode = "lines", line = list(color = "rgb(160,235,240)"), legendgroup = "NewHampshire",
name = "New Hampshire - Price Increases", visible = "legendonly") %>% add_trace(data = filter(realtor_priceincdec,
name == "NewHampshire") %>% filter(value_id == "Realtor_PriceReducedCount"),
type = "scatter", mode = "lines", fill = "tonexty", fillcolor = "rgba(160,235,240,0.2)",
line = list(color = "rgba(160,235,240,0.4)"), legendgroup = "NewHampshire", name = "New Hampshire - Price Reductions",
visible = "legendonly") %>% add_trace(data = filter(realtor_priceincdec, value_id ==
"Realtor_PriceIncreasedCount") %>% filter(name == "NewJersey"), x = ~dates, y = ~data,
type = "scatter", mode = "lines", line = list(color = "rgb(170,205,230)"), legendgroup = "NewJersey",
name = "New Jersey - Price Increases", visible = "legendonly") %>% add_trace(data = filter(realtor_priceincdec,
name == "NewJersey") %>% filter(value_id == "Realtor_PriceReducedCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(170,205,230,0.2)", line = list(color = "rgba(170,205,230,0.4)"),
legendgroup = "NewJersey", name = "New Jersey - Price Reductions", visible = "legendonly") %>%
add_trace(data = filter(realtor_priceincdec, value_id == "Realtor_PriceIncreasedCount") %>%
filter(name == "NewMexico"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(255,205,160)"), legendgroup = "NewMexico", name = "New Mexico - Price Increases",
visible = "legendonly") %>% add_trace(data = filter(realtor_priceincdec,
name == "NewMexico") %>% filter(value_id == "Realtor_PriceReducedCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(255,205,160,0.2)", line = list(color = "rgba(255,205,160,0.4)"),
legendgroup = "NewMexico", name = "New Mexico - Price Reductions", visible = "legendonly") %>%
add_trace(data = filter(realtor_priceincdec, value_id == "Realtor_PriceIncreasedCount") %>%
filter(name == "NewYork"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(170,225,175)"), legendgroup = "NewYork", name = "New York - Price Increases",
visible = "legendonly") %>% add_trace(data = filter(realtor_priceincdec,
name == "NewYork") %>% filter(value_id == "Realtor_PriceReducedCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(170,225,175,0.2)", line = list(color = "rgba(170,225,175,0.4)"),
legendgroup = "NewYork", name = "New York - Price Reductions", visible = "legendonly") %>%
add_trace(data = filter(realtor_priceincdec, value_id == "Realtor_PriceIncreasedCount") %>%
filter(name == "NorthCarolina"), x = ~dates, y = ~data, type = "scatter",
mode = "lines", line = list(color = "rgb(250,170,175)"), legendgroup = "NorthCarolina",
name = "North Carolina - Price Increases", visible = "legendonly") %>% add_trace(data = filter(realtor_priceincdec,
name == "NorthCarolina") %>% filter(value_id == "Realtor_PriceReducedCount"),
type = "scatter", mode = "lines", fill = "tonexty", fillcolor = "rgba(250,170,175,0.2)",
line = list(color = "rgba(250,170,175,0.4)"), legendgroup = "NorthCarolina",
name = "North Carolina - Price Reductions", visible = "legendonly") %>% add_trace(data = filter(realtor_priceincdec,
value_id == "Realtor_PriceIncreasedCount") %>% filter(name == "NorthDakota"),
x = ~dates, y = ~data, type = "scatter", mode = "lines", line = list(color = "rgb(220,195,235)"),
legendgroup = "NorthDakota", name = "North Dakota - Price Increases", visible = "legendonly") %>%
add_trace(data = filter(realtor_priceincdec, name == "NorthDakota") %>% filter(value_id ==
"Realtor_PriceReducedCount"), type = "scatter", mode = "lines", fill = "tonexty",
fillcolor = "rgba(220,195,235,0.2)", line = list(color = "rgba(220,195,235,0.4)"),
legendgroup = "NorthDakota", name = "North Dakota - Price Reductions", visible = "legendonly") %>%
add_trace(data = filter(realtor_priceincdec, value_id == "Realtor_PriceIncreasedCount") %>%
filter(name == "Ohio"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(215,190,190)"), legendgroup = "Ohio", name = "Ohio - Price Increases",
visible = "legendonly") %>% add_trace(data = filter(realtor_priceincdec,
name == "Ohio") %>% filter(value_id == "Realtor_PriceReducedCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(215,190,190,0.2)", line = list(color = "rgba(215,190,190,0.4)"),
legendgroup = "Ohio", name = "Ohio - Price Reductions", visible = "legendonly") %>%
add_trace(data = filter(realtor_priceincdec, value_id == "Realtor_PriceIncreasedCount") %>%
filter(name == "Oklahoma"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(250,200,235)"), legendgroup = "Oklahoma", name = "Oklahoma - Price Increases",
visible = "legendonly") %>% add_trace(data = filter(realtor_priceincdec,
name == "Oklahoma") %>% filter(value_id == "Realtor_PriceReducedCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(250,200,235,0.2)", line = list(color = "rgba(250,200,235,0.4)"),
legendgroup = "Oklahoma", name = "Oklahoma - Price Reductions", visible = "legendonly") %>%
add_trace(data = filter(realtor_priceincdec, value_id == "Realtor_PriceIncreasedCount") %>%
filter(name == "Oregon"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(210,210,210)"), legendgroup = "Oregon", name = "Oregon - Price Increases",
visible = "legendonly") %>% add_trace(data = filter(realtor_priceincdec,
name == "Oregon") %>% filter(value_id == "Realtor_PriceReducedCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(210,210,210,0.2)", line = list(color = "rgba(210,210,210,0.4)"),
legendgroup = "Oregon", name = "Oregon - Price Reductions", visible = "legendonly") %>%
add_trace(data = filter(realtor_priceincdec, value_id == "Realtor_PriceIncreasedCount") %>%
filter(name == "Pennsylvania"), x = ~dates, y = ~data, type = "scatter",
mode = "lines", line = list(color = "rgb(230,235,170)"), legendgroup = "Pennsylvania",
name = "Pennsylvania - Price Increases", visible = "legendonly") %>% add_trace(data = filter(realtor_priceincdec,
name == "Pennsylvania") %>% filter(value_id == "Realtor_PriceReducedCount"),
type = "scatter", mode = "lines", fill = "tonexty", fillcolor = "rgba(230,235,170,0.2)",
line = list(color = "rgba(230,235,170,0.4)"), legendgroup = "Pennsylvania", name = "Pennsylvania - Price Reductions",
visible = "legendonly") %>% add_trace(data = filter(realtor_priceincdec, value_id ==
"Realtor_PriceIncreasedCount") %>% filter(name == "PuertoRico"), x = ~dates,
y = ~data, type = "scatter", mode = "lines", line = list(color = "rgb(160,235,240)"),
legendgroup = "PuertoRico", name = "Puerto Rico - Price Increases", visible = "legendonly") %>%
add_trace(data = filter(realtor_priceincdec, name == "PuertoRico") %>% filter(value_id ==
"Realtor_PriceReducedCount"), type = "scatter", mode = "lines", fill = "tonexty",
fillcolor = "rgba(160,235,240,0.2)", line = list(color = "rgba(160,235,240,0.4)"),
legendgroup = "PuertoRico", name = "Puerto Rico - Price Reductions", visible = "legendonly") %>%
add_trace(data = filter(realtor_priceincdec, value_id == "Realtor_PriceIncreasedCount") %>%
filter(name == "RhodeIsland"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(170,205,230)"), legendgroup = "RhodeIsland", name = "Rhode Island - Price Increases",
visible = "legendonly") %>% add_trace(data = filter(realtor_priceincdec,
name == "RhodeIsland") %>% filter(value_id == "Realtor_PriceReducedCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(170,205,230,0.2)", line = list(color = "rgba(170,205,230,0.4)"),
legendgroup = "RhodeIsland", name = "Rhode Island - Price Reductions", visible = "legendonly") %>%
add_trace(data = filter(realtor_priceincdec, value_id == "Realtor_PriceIncreasedCount") %>%
filter(name == "SouthCarolina"), x = ~dates, y = ~data, type = "scatter",
mode = "lines", line = list(color = "rgb(255,205,160)"), legendgroup = "SouthCarolina",
name = "South Carolina - Price Increases", visible = "legendonly") %>% add_trace(data = filter(realtor_priceincdec,
name == "SouthCarolina") %>% filter(value_id == "Realtor_PriceReducedCount"),
type = "scatter", mode = "lines", fill = "tonexty", fillcolor = "rgba(255,205,160,0.2)",
line = list(color = "rgba(255,205,160,0.4)"), legendgroup = "SouthCarolina",
name = "South Carolina - Price Reductions", visible = "legendonly") %>% add_trace(data = filter(realtor_priceincdec,
value_id == "Realtor_PriceIncreasedCount") %>% filter(name == "SouthDakota"),
x = ~dates, y = ~data, type = "scatter", mode = "lines", line = list(color = "rgb(170,225,175)"),
legendgroup = "SouthDakota", name = "South Dakota - Price Increases", visible = "legendonly") %>%
add_trace(data = filter(realtor_priceincdec, name == "SouthDakota") %>% filter(value_id ==
"Realtor_PriceReducedCount"), type = "scatter", mode = "lines", fill = "tonexty",
fillcolor = "rgba(170,225,175,0.2)", line = list(color = "rgba(170,225,175,0.4)"),
legendgroup = "SouthDakota", name = "South Dakota - Price Reductions", visible = "legendonly") %>%
add_trace(data = filter(realtor_priceincdec, value_id == "Realtor_PriceIncreasedCount") %>%
filter(name == "Tennessee"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(250,170,175)"), legendgroup = "Tennessee", name = "Tennessee - Price Increases",
visible = "legendonly") %>% add_trace(data = filter(realtor_priceincdec,
name == "Tennessee") %>% filter(value_id == "Realtor_PriceReducedCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(250,170,175,0.2)", line = list(color = "rgba(250,170,175,0.4)"),
legendgroup = "Tennessee", name = "Tennessee - Price Reductions", visible = "legendonly") %>%
add_trace(data = filter(realtor_priceincdec, value_id == "Realtor_PriceIncreasedCount") %>%
filter(name == "Texas"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(220,195,235)"), legendgroup = "Texas", name = "Texas - Price Increases",
visible = "legendonly") %>% add_trace(data = filter(realtor_priceincdec,
name == "Texas") %>% filter(value_id == "Realtor_PriceReducedCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(220,195,235,0.2)", line = list(color = "rgba(220,195,235,0.4)"),
legendgroup = "Texas", name = "Texas - Price Reductions", visible = "legendonly") %>%
add_trace(data = filter(realtor_priceincdec, value_id == "Realtor_PriceIncreasedCount") %>%
filter(name == "Utah"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(215,190,190)"), legendgroup = "Utah", name = "Utah - Price Increases",
visible = "legendonly") %>% add_trace(data = filter(realtor_priceincdec,
name == "Utah") %>% filter(value_id == "Realtor_PriceReducedCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(215,190,190,0.2)", line = list(color = "rgba(215,190,190,0.4)"),
legendgroup = "Utah", name = "Utah - Price Reductions", visible = "legendonly") %>%
add_trace(data = filter(realtor_priceincdec, value_id == "Realtor_PriceIncreasedCount") %>%
filter(name == "Vermont"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(250,200,235)"), legendgroup = "Vermont", name = "Vermont - Price Increases",
visible = "legendonly") %>% add_trace(data = filter(realtor_priceincdec,
name == "Vermont") %>% filter(value_id == "Realtor_PriceReducedCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(250,200,235,0.2)", line = list(color = "rgba(250,200,235,0.4)"),
legendgroup = "Vermont", name = "Vermont - Price Reductions", visible = "legendonly") %>%
add_trace(data = filter(realtor_priceincdec, value_id == "Realtor_PriceIncreasedCount") %>%
filter(name == "Virginia"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(210,210,210)"), legendgroup = "Virginia", name = "Virginia - Price Increases",
visible = "legendonly") %>% add_trace(data = filter(realtor_priceincdec,
name == "Virginia") %>% filter(value_id == "Realtor_PriceReducedCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(210,210,210,0.2)", line = list(color = "rgba(210,210,210,0.4)"),
legendgroup = "Virginia", name = "Virginia - Price Reductions", visible = "legendonly") %>%
add_trace(data = filter(realtor_priceincdec, value_id == "Realtor_PriceIncreasedCount") %>%
filter(name == "Washington"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(230,235,170)"), legendgroup = "Washington", name = "Washington - Price Increases",
visible = "legendonly") %>% add_trace(data = filter(realtor_priceincdec,
name == "Washington") %>% filter(value_id == "Realtor_PriceReducedCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(230,235,170,0.2)", line = list(color = "rgba(230,235,170,0.4)"),
legendgroup = "Washington", name = "Washington - Price Reductions", visible = "legendonly") %>%
add_trace(data = filter(realtor_priceincdec, value_id == "Realtor_PriceIncreasedCount") %>%
filter(name == "WestVirginia"), x = ~dates, y = ~data, type = "scatter",
mode = "lines", line = list(color = "rgb(160,235,240)"), legendgroup = "WestVirginia",
name = "West Virginia - Price Increases", visible = "legendonly") %>% add_trace(data = filter(realtor_priceincdec,
name == "WestVirginia") %>% filter(value_id == "Realtor_PriceReducedCount"),
type = "scatter", mode = "lines", fill = "tonexty", fillcolor = "rgba(160,235,240,0.2)",
line = list(color = "rgba(160,235,240,0.4)"), legendgroup = "WestVirginia", name = "West Virginia - Price Reductions",
visible = "legendonly") %>% add_trace(data = filter(realtor_priceincdec, value_id ==
"Realtor_PriceIncreasedCount") %>% filter(name == "Wisconsin"), x = ~dates, y = ~data,
type = "scatter", mode = "lines", line = list(color = "rgb(170,205,230)"), legendgroup = "Wisconsin",
name = "Wisconsin - Price Increases", visible = "legendonly") %>% add_trace(data = filter(realtor_priceincdec,
name == "Wisconsin") %>% filter(value_id == "Realtor_PriceReducedCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(170,205,230,0.2)", line = list(color = "rgba(170,205,230,0.4)"),
legendgroup = "Wisconsin", name = "Wisconsin - Price Reductions", visible = "legendonly") %>%
add_trace(data = filter(realtor_priceincdec, value_id == "Realtor_PriceIncreasedCount") %>%
filter(name == "Wyoming"), x = ~dates, y = ~data, type = "scatter", mode = "lines",
line = list(color = "rgb(255,210,165)"), legendgroup = "Wyoming", name = "Wyoming - Price Increases",
visible = "legendonly") %>% add_trace(data = filter(realtor_priceincdec,
name == "Wyoming") %>% filter(value_id == "Realtor_PriceReducedCount"), type = "scatter",
mode = "lines", fill = "tonexty", fillcolor = "rgba(255,210,165,0.2)", line = list(color = "rgba(255,210,165,0.4)"),
legendgroup = "Wyoming", name = "Wyoming - Price Reductions", visible = "legendonly") %>%
layout(title = "Counts of Price Increases and Decreases (07/2016-11/2020)", paper_bgcolor = "rgb(200,200,200)",
plot_bgcolor = "rgb(150,150,150)", xaxis = list(title = "Month", gridcolor = "rgb(255,255,255)",
showgrid = TRUE, showline = FALSE, showticklabels = TRUE, tickcolor = "rgb(127,127,127)",
ticks = "outside", zeroline = FALSE), yaxis = list(title = "Counts",
gridcolor = "rgb(255,255,255)", showgrid = TRUE, showline = FALSE, showticklabels = TRUE,
tickcolor = "rgb(127,127,127)", ticks = "outside", zeroline = FALSE),
margin = list(l = 80, r = 80, b = 75, t = 100, pad = 4))
How have sellers responded to decreased demand? It looks like price reductions may have been related to increasing sales, as seen by the declining levels of active listings prior to April, the practice of reducing listing prices dramatically declined after March.
Median Days on Market (DOM)
The median number of days property listings spend on the market within the specified geography during the specified month. Time spent on the market is defined as the time between the initial listing of a property and either its closing date or the date it is taken off the market.
realtor_dom <- realtor_stats %>% mutate(name = name %>% str_remove("_UnitedStates")) %>%
filter(value_id %in% c("Realtor_AvgMedianDaysOnMarket"), missing == 0) %>% select(name,
dates, data)
plot_ly(filter(realtor_dom, name == "Hawaii"), x = ~dates, y = ~data, name = "Hawaii",
type = "scatter", mode = "lines") %>% add_trace(data = filter(realtor_dom, name ==
"Alabama"), x = ~dates, y = ~data, opacity = 0.3, name = "Alabama", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_dom,
name == "Alaska"), x = ~dates, y = ~data, opacity = 0.3, name = "Alaska", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_dom,
name == "Arizona"), x = ~dates, y = ~data, opacity = 0.3, name = "Arizona", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_dom,
name == "Arkansas"), x = ~dates, y = ~data, opacity = 0.3, name = "Arkansas",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_dom,
name == "California"), x = ~dates, y = ~data, opacity = 0.3, name = "California",
type = "scatter", mode = "lines") %>% add_trace(data = filter(realtor_dom, name ==
"Colorado"), x = ~dates, y = ~data, opacity = 0.3, name = "Colorado", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_dom,
name == "Connecticut"), x = ~dates, y = ~data, opacity = 0.3, name = "Connecticut",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_dom,
name == "Delaware"), x = ~dates, y = ~data, opacity = 0.3, name = "Delaware",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_dom,
name == "DistrictofColumbia"), x = ~dates, y = ~data, opacity = 0.3, name = "District of Columbia",
type = "scatter", mode = "lines") %>% add_trace(data = filter(realtor_dom, name ==
"Florida"), x = ~dates, y = ~data, opacity = 0.3, name = "Florida", type = "scatter",
mode = "lines") %>% add_trace(data = filter(realtor_dom, name == "Georgia"),
x = ~dates, y = ~data, opacity = 0.3, name = "Georgia", type = "scatter", mode = "lines",
visible = "legendonly") %>% add_trace(data = filter(realtor_dom, name == "Idaho"),
x = ~dates, y = ~data, opacity = 0.3, name = "Idaho", type = "scatter", mode = "lines",
visible = "legendonly") %>% add_trace(data = filter(realtor_dom, name == "Illinois"),
x = ~dates, y = ~data, opacity = 0.3, name = "Illinois", type = "scatter", mode = "lines",
visible = "legendonly") %>% add_trace(data = filter(realtor_dom, name == "Indiana"),
x = ~dates, y = ~data, opacity = 0.3, name = "Indiana", type = "scatter", mode = "lines",
visible = "legendonly") %>% add_trace(data = filter(realtor_dom, name == "Iowa"),
x = ~dates, y = ~data, opacity = 0.3, name = "Iowa", type = "scatter", mode = "lines",
visible = "legendonly") %>% add_trace(data = filter(realtor_dom, name == "Kansas"),
x = ~dates, y = ~data, opacity = 0.3, name = "Kansas", type = "scatter", mode = "lines",
visible = "legendonly") %>% add_trace(data = filter(realtor_dom, name == "Kentucky"),
x = ~dates, y = ~data, opacity = 0.3, name = "Kentucky", type = "scatter", mode = "lines",
visible = "legendonly") %>% add_trace(data = filter(realtor_dom, name == "Louisiana"),
x = ~dates, y = ~data, opacity = 0.3, name = "Louisiana", type = "scatter", mode = "lines",
visible = "legendonly") %>% add_trace(data = filter(realtor_dom, name == "Maine"),
x = ~dates, y = ~data, opacity = 0.3, name = "Maine", type = "scatter", mode = "lines",
visible = "legendonly") %>% add_trace(data = filter(realtor_dom, name == "Maryland"),
x = ~dates, y = ~data, opacity = 0.3, name = "Maryland", type = "scatter", mode = "lines",
visible = "legendonly") %>% add_trace(data = filter(realtor_dom, name == "Massachusetts"),
x = ~dates, y = ~data, opacity = 0.3, name = "Massachusetts", type = "scatter",
mode = "lines") %>% add_trace(data = filter(realtor_dom, name == "Michigan"),
x = ~dates, y = ~data, opacity = 0.3, name = "Michigan", type = "scatter", mode = "lines",
visible = "legendonly") %>% add_trace(data = filter(realtor_dom, name == "Minnesota"),
x = ~dates, y = ~data, opacity = 0.3, name = "Minnesota", type = "scatter", mode = "lines",
visible = "legendonly") %>% add_trace(data = filter(realtor_dom, name == "Mississippi"),
x = ~dates, y = ~data, opacity = 0.3, name = "Mississippi", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_dom,
name == "Missouri"), x = ~dates, y = ~data, opacity = 0.3, name = "Missouri",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_dom,
name == "Montana"), x = ~dates, y = ~data, opacity = 0.3, name = "Montana", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_dom,
name == "Nebraska"), x = ~dates, y = ~data, opacity = 0.3, name = "Nebraska",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_dom,
name == "Nevada"), x = ~dates, y = ~data, opacity = 0.3, name = "Nevada", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_dom,
name == "NewHampshire"), x = ~dates, y = ~data, opacity = 0.3, name = "New Hampshire",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_dom,
name == "NewJersey"), x = ~dates, y = ~data, opacity = 0.3, name = "New Jersey",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_dom,
name == "NewMexico"), x = ~dates, y = ~data, opacity = 0.3, name = "New Mexico",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_dom,
name == "NewYork"), x = ~dates, y = ~data, opacity = 0.3, name = "New York",
type = "scatter", mode = "lines") %>% add_trace(data = filter(realtor_dom, name ==
"NorthCarolina"), x = ~dates, y = ~data, opacity = 0.3, name = "North Carolina",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_dom,
name == "NorthDakota"), x = ~dates, y = ~data, opacity = 0.3, name = "North Dakota",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_dom,
name == "Ohio"), x = ~dates, y = ~data, opacity = 0.3, name = "Ohio", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_dom,
name == "Oklahoma"), x = ~dates, y = ~data, opacity = 0.3, name = "Oklahoma",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_dom,
name == "Oregon"), x = ~dates, y = ~data, opacity = 0.3, name = "Oregon", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_dom,
name == "Pennsylvania"), x = ~dates, y = ~data, opacity = 0.3, name = "Pennsylvania",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_dom,
name == "PuertoRico"), x = ~dates, y = ~data, opacity = 0.3, name = "Puerto Rico",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_dom,
name == "RhodeIsland"), x = ~dates, y = ~data, opacity = 0.3, name = "Rhode Island",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_dom,
name == "SouthCarolina"), x = ~dates, y = ~data, opacity = 0.3, name = "South Carolina",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_dom,
name == "SouthDakota"), x = ~dates, y = ~data, opacity = 0.3, name = "South Dakota",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_dom,
name == "Tennessee"), x = ~dates, y = ~data, opacity = 0.3, name = "Tennessee",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_dom,
name == "Texas"), x = ~dates, y = ~data, opacity = 0.3, name = "Texas", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_dom,
name == "Utah"), x = ~dates, y = ~data, opacity = 0.3, name = "Utah", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_dom,
name == "Vermont"), x = ~dates, y = ~data, opacity = 0.3, name = "Vermont", type = "scatter",
mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_dom,
name == "Virginia"), x = ~dates, y = ~data, opacity = 0.3, name = "Virginia",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_dom,
name == "Washington"), x = ~dates, y = ~data, opacity = 0.3, name = "Washington",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_dom,
name == "WestVirginia"), x = ~dates, y = ~data, opacity = 0.3, name = "West Virginia",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_dom,
name == "Wisconsin"), x = ~dates, y = ~data, opacity = 0.3, name = "Wisconsin",
type = "scatter", mode = "lines", visible = "legendonly") %>% add_trace(data = filter(realtor_dom,
name == "Wyoming"), x = ~dates, y = ~data, opacity = 0.3, name = "Wyoming", type = "scatter",
mode = "lines", visible = "legendonly") %>% layout(title = "Median Days on Market (07/2016-11/2020)",
xaxis = list(title = "Month", titlefont = f1, showticklabels = TRUE, tickfont = f2,
exponentformat = "E"), yaxis = list(title = "Days", titlefont = f1, showticklabels = TRUE,
tickfont = f2), margin = list(l = 80, r = 80, b = 100, t = 100, pad = 4))
After June 2020, there was a sharp drop in the median days a listing spent on the market. This coincides with when average listing prices bottomed out and when the number of active listings were at its highest. This suggests that either demand picked up again or sellers began taking their listings off the market and constrict supply (instead of lowering their prices, so as to protect the value of their real estate).
The sharp decline in DOM was a common pattern across the country. Homes stay on the market by January (which may explain why new and active listings are also at its lowest during this time), and homes are quickly snatched up in June (when price reductions are most common and the number of active and new listings are the highest). In 2020, however, the country’s hottest housing markets hit peaks in DOM in May/June, when it is usually the lowest time of year in terms of DOM.
References
C3.ai. 2020. Creating a Unified COVID-19 Global Resource in Record Time. https://c3.ai/customers/covid-19-data-lake/.
Thomas Hale, Sam Webster, Anna Petherick, Toby Phillips, and Beatriz Kira. 2020. Oxford COVID-19 Government Response Tracker. Blavatnik School of Government. https://github.com/OxCGRT/covid-policy-tracker.
Victor Couture, Jonathan I. Dingel, Allison Green, Jessie Handbury, and Kevin R. Williams. 3 July 2020. Measuring movement and social contact with smartphone data: a real-time application to COVID-19. https://github.com/COVIDExposureIndices/COVIDExposureIndices/blob/master/CDGHW.pdf
The London School of Economics and Political Science, School of Government↩︎
Socializing & COVID (3D View)
In the same manner, we can see the relationship between case increases and device exposures. Here, the color scheme will represent changes in mobility.
Here, we can see a decline in mobility and exposures was followed by a decrease in the rate of case increases.
In Florida, a lower level of exposures was followed by a drastic decrease in the case rate. However, this was followed by a quick rebound and the rate of case increases is headed back towards the summer peak.