Cases

Row

Total Number of Cases in the United States

103,801,403

Percent of US Population

31.32%

Column

Total Number of Cases

Percent of State Population Affected

Table

Deaths

Row

Total Number of Covid Fatalities in the United States

1,134,722

Percent of US Population

0.34%

Column

Total Number of Covid Fatalities

Percent of Population

Table

Cases

Row

Total Number of Cases in the Oregon

738,830

Percent of Cases

17.52%

Column

Total Number of Covid Cases Map

Covid Cases Percent of Population Map

Table

Deaths

Row

Total Number of Covid Fatalitites in Oregon

7,560

Percent of OR Population

0.18%

Column

Total Number of Covid Fatalities

Percent of Population

Table

Project

The COVID-19 pandemic has had a significant impact on the world, and the United States has been hit particularly hard. With millions of reported cases and hundreds of thousands of deaths, the need for accurate data analysis has become increasingly important. This data analysis project focuses on the cases and deaths related to COVID-19 in the United States and my home state, Oregon. The goal of this project is to explore and compare the trends in cases and deaths in both areas.

Knowing and understanding the information provided in this dashboard is important in several ways. It enables policymakers to tailor measure such as social distancing and stay-at-home orders to specific regions, thereby reducing the overall spread of the virus. Additionally, understanding which areas have been most affected by the pandemic can help identify population groups that may be at higher risk. Finally, tracking trends can help identify areas where the virus is spreading more rapidly and inform decisions around the allocation of resources and policy interventions. Overall, knowing areas with high numbers and percents of COVID-19 cases and deaths is critical in the fight against the pandemic and minimizing its impact on individuals and communities.

Author

Randi Bolt

Github | Blog | Mastodon | Linkedin

I am a data analyst who uses data science and machine learning techniques to extrapolate insight from data.

I am constantly exploring new topics, and ways to improve upon past and current work.

I graduated magna cum laude with a BS in Mathematics from Portland State University in 2022.

I was born, raised, and am currently based out of Portland, Oregon.

---
title: "Covid Dashboard"
output: 
  flexdashboard::flex_dashboard:
    orientation: row
    vertical_layout: fill
    source_code: embed
    theme:
      version: 4
      bootswatch: flatly
---


```{r setup, include=FALSE}
#### Covid Dashboard ####
# Title: Index
# Date: May 26, 2023
# Description: This file loads in the 
# necessary packages, functions, and data.
# Then creates data visuals and analysis in 
# the form of an interactive dashboard. 
here::i_am("index.Rmd")

#### Load Packages ####
# flexdashboard: To create dashboards in R. 
# fontawesome: To access "fa" icons.  
# tidyverse: A collection of data-related packages.
# plotly: Converts static plots to interactive plots.
# reactable: Reactive Tables. 
base::library(flexdashboard)
base::library(fontawesome)
base::library(tidyverse)
base::library(plotly)
base::library(reactable)

#### Load Functions ####
# source(): Accept input in R. 
base::source("fig-functions/us_case_num_map.R")
base::source("fig-functions/us_case_perc_map.R")
base::source("fig-functions/us_death_num_map.R")
base::source("fig-functions/us_death_perc_map.R")
base::source("fig-functions/or_case_num_map.R")
base::source("fig-functions/or_case_perc_map.R")
base::source("fig-functions/or_death_num_map.R")
base::source("fig-functions/or_death_perc_map.R")

#### Load Data ###
us_page_data <- readr::read_csv("clean-data/us_page_data.csv")
us_totals <- readr::read_csv("clean-data/us_totals.csv")
or_page_data <- readr::read_csv("clean-data/or_page_data.csv")
or_totals <- readr::read_csv("clean-data/or_totals.csv")
```


Cases {data-navmenu="United States"}
=======================================================================

Sidebar {.sidebar}
-----------------------------------------------------------------------

### Cases Stats

**Most Cases**: `r us_page_data[[1,2]]` with `r formatC(us_page_data[[1,3]], format = "d", big.mark = ",")` total cases. 

**Least Cases**: `r us_page_data[[2,2]]` with `r formatC(us_page_data[[2,3]], format = "d", big.mark = ",")` total cases. 

**Highest Percentage**: `r us_page_data[[3,2]]` with `r us_page_data[[3,3]]`% of their population tested positive for covid-19.

**Least Percentage**: `r us_page_data[[4,2]]` with `r us_page_data[[4,3]]`% of their population tested positive for covid-19.


Row
----------------------------------------------------------------------

### Total Number of Cases in the United States

```{r us case num box}
valueBox("103,801,403", color = "#b52121")
```

### Percent of US Population

```{r us case perc box}
valueBox("31.32%", icon = "fa-stethoscope", color = "#b52121")
```


Column {.tabset}
-----------------------------------------------------------------------

### Total Number of Cases

```{r us case num map}
plotly::ggplotly(us_case_num_map()) 
```

### Percent of State Population Affected

```{r us case perc map}
plotly::ggplotly(us_case_perc_map())
```

### Table 

```{r us cases table}
reactable::reactable(
  us_totals,
  # modify columns
  columns = list(
    ...1 = colDef(
      show = F),
    state = colDef(
      name = "State"),
    population = colDef(
      name = "Population",
      format = colFormat(
        separators = TRUE)),
    total_cases = colDef(
      name = "Total Cases",
      format = colFormat(
        separators = TRUE)),
    total_cases_perc = colDef(
      name = "Percent of Population",
      format = colFormat(
        percent = TRUE,
        digits = 2)),
    total_deaths = colDef(show = F),
    total_deaths_perc = colDef(show = F)),
  # table formatting
  defaultSorted = list(total_cases = "desc"),
  bordered = TRUE,
  highlight = TRUE,
  showPageSizeOptions = TRUE,
  pageSizeOptions = c(5, 10, 20, 50),
  defaultPageSize = 10)
```


Deaths {data-navmenu="United States"}
=======================================================================

Sidebar {.sidebar}
-----------------------------------------------------------------------

### Deaths Stats

**Most Deaths**: `r us_page_data[[5,2]]` with `r formatC(us_page_data[[5,3]], format = "d", big.mark = ",")` total deaths.

**Least Deaths**: `r us_page_data[[6,2]]` with `r formatC(us_page_data[[6,3]], format = "d", big.mark = ",")` total deaths.

**Highest Percentage**: `r us_page_data[[7,2]]` with `r us_page_data[[7,3]]`% of their population died from covid-19.

**Least Percentage**: `r us_page_data[[8,2]]` with `r us_page_data[[8,3]]`% of their population died from covid-19.


Row
----------------------------------------------------------------------

### Total Number of Covid Fatalities in the United States

```{r us death num box}
valueBox("1,134,722", color = "#b52121")
```

### Percent of US Population

```{r us death perc box}
valueBox("0.34%", icon = "fa-skull", color = "#b52121")
```


Column {.tabset}
-----------------------------------------------------------------------

### Total Number of Covid Fatalities

```{r us death num map}
ggplotly(us_death_num_map()) 
```


### Percent of Population 

```{r us death perc map}
plotly::ggplotly(us_death_perc_map())
```


### Table

```{r us deaths table}
reactable::reactable(
  us_totals,
  # modify columns
  columns = list(
    ...1 = colDef(
      show = F),
    state = colDef(
      name = "State"),
    population = colDef(
      name = "Population",
      format = colFormat(
        separators = TRUE)),
    total_deaths = colDef(
      name = "Total Deaths",
      format = colFormat(
        separators = TRUE)),
    total_deaths_perc = colDef(
      name = "Percent of Population",
      format = colFormat(
        percent = TRUE,
        digits = 2)),
    total_cases = colDef(show = F),
    total_cases_perc = colDef(show = F)),
  # table formatting
  defaultSorted = list(total_deaths = "desc"),
  bordered = TRUE,
  highlight = TRUE,
  showPageSizeOptions = TRUE,
  pageSizeOptions = c(5, 10, 20, 50),
  defaultPageSize = 10)
```


Cases {data-navmenu="Oregon"}
=======================================================================

Sidebar {.sidebar}
-----------------------------------------------------------------------

### Cases Stats

**Most Cases**: `r or_page_data[[1,2]]` with `r formatC(or_page_data[[1,3]], format = "d", big.mark = ",")` total cases. 

**Least Cases**: `r or_page_data[[2,2]]` with `r formatC(or_page_data[[2,3]], format = "d", big.mark = ",")` total cases. 

**Highest Percentage**: `r or_page_data[[3,2]]` with `r or_page_data[[3,3]]`% of their population tested positive for covid-19.

**Least Percentage**: `r or_page_data[[4,2]]` with `r or_page_data[[4,3]]`% of their population tested positive for covid-19.

Row
----------------------------------------------------------------------

### Total Number of Cases in the Oregon

```{r or case num box}
valueBox("738,830", color = "#b52121")
```

### Percent of Cases 

```{r or case perc box}
valueBox("17.52%", icon = "fa-stethoscope", color = "#b52121")
```


Column {.tabset}
-----------------------------------------------------------------------

### Total Number of Covid Cases Map

```{r or case num map}
plotly::ggplotly(or_case_num_map()) 
```


### Covid Cases Percent of Population Map

```{r or case perc map}
plotly::ggplotly(or_case_perc_map()) 
```


### Table

```{r or cases table}
reactable::reactable(
  or_totals,
  # modify columns
  columns = list(
    ...1 = colDef(
      show = F),
    county = colDef(
      name = "County"),
    population = colDef(
      name = "Population",
      format = colFormat(
        separators = TRUE)),
    total_cases = colDef(
      name = "Total Cases",
      format = colFormat(
        separators = TRUE)),
    total_cases_perc = colDef(
      name = "Percent of Population",
      format = colFormat(
        percent = TRUE,
        digits = 2)),
    total_deaths = colDef(show = F),
    total_deaths_perc = colDef(show = F)),
  # table formatting
  defaultSorted = list(total_cases = "desc"),
  bordered = TRUE,
  highlight = TRUE,
  showPageSizeOptions = TRUE,
  pageSizeOptions = c(5, 10, 20, 30, 36),
  defaultPageSize = 10)
```



Deaths {data-navmenu="Oregon"}
=======================================================================

Sidebar {.sidebar}
-----------------------------------------------------------------------

### Deaths Stats

**Most Deaths**: `r or_page_data[[5,2]]` with `r formatC(or_page_data[[5,3]], format = "d", big.mark = ",")` total deaths.

**Least Deaths**: `r or_page_data[[6,2]]` with `r formatC(or_page_data[[6,3]], format = "d", big.mark = ",")` total deaths.

**Highest Percentage**: `r or_page_data[[7,2]]` with `r or_page_data[[7,3]]`% of their population died from covid-19.

**Least Percentage**: `r or_page_data[[8,2]]` with `r or_page_data[[8,3]]`% of their population died from covid-19.


Row
----------------------------------------------------------------------

### Total Number of Covid Fatalitites in Oregon

```{r or death num box}
valueBox("7,560", color = "#b52121")
```

### Percent of OR Population

```{r or death perc box}
valueBox("0.18%", icon = "fa-stethoscope", color = "#b52121")
```


Column {.tabset}
-----------------------------------------------------------------------

### Total Number of Covid Fatalities

```{r or deaths num map}
plotly::ggplotly(or_death_num_map())
```


### Percent of Population

```{r or death perc map}
plotly::ggplotly(or_death_perc_map())
```


### Table

```{r or deaths table}
reactable::reactable(
  or_totals,
  # modify columns
  columns = list(
    ...1 = colDef(
      show = F),
    county = colDef(
      name = "County"),
    population = colDef(
      name = "Population",
      format = colFormat(
        separators = TRUE)),
    total_deaths = colDef(
      name = "Total Deaths",
      format = colFormat(
        separators = TRUE)),
    total_deaths_perc = colDef(
      name = "Percent of Population",
      format = colFormat(
        percent = TRUE,
        digits = 2)),
    total_cases = colDef(show = F),
    total_cases_perc = colDef(show = F)),
  # table formatting
  defaultSorted = list(total_deaths = "desc"),
  bordered = TRUE,
  highlight = TRUE,
  showPageSizeOptions = TRUE,
  pageSizeOptions = c(5, 10, 20, 30, 36),
  defaultPageSize = 10)
```



Project {data-navmenu="About"}
=======================================================================

The COVID-19 pandemic has had a significant impact on the world, and the United States has been hit particularly hard. With millions of reported cases and hundreds of thousands of deaths, the need for accurate data analysis has become increasingly important. This data analysis project focuses on the cases and deaths related to COVID-19 in the United States and my home state, Oregon. The goal of this project is to explore and compare the trends in cases and deaths in both areas.

Knowing and understanding the information provided in this dashboard is important in several ways. It enables policymakers to tailor measure such as social distancing and stay-at-home orders to specific regions, thereby reducing the overall spread of the virus. Additionally, understanding which areas have been most affected by the pandemic can help identify population groups that may be at higher risk. Finally, tracking trends can help identify areas where the virus is spreading more rapidly and inform decisions around the allocation of resources and policy interventions. Overall, knowing areas with high numbers and percents of COVID-19 cases and deaths is critical in the fight against the pandemic and minimizing its impact on individuals and communities.

Author {data-navmenu="About"}
=======================================================================

<center>

### Randi Bolt

[Github](https://github.com/rbolt13) | [Blog](https://www.rbolt.me/) | [Mastodon](https://pnw.zone/@rbolt) | [Linkedin](https://www.linkedin.com/in/randi-bolt/)

I am a data analyst who uses data science and machine learning techniques to extrapolate insight from data.

I am constantly exploring new topics, and ways to improve upon past and current work.

I graduated magna cum laude with a BS in Mathematics from Portland State University in 2022.

I was born, raised, and am currently based out of Portland, Oregon.

</center>