# set working directory and load data
setwd("/Users/cameliaguild/Rpubs")
df <- read.csv("./Data/Mayo clinic.csv", header = TRUE)
# load libraries
library(tidyverse)
library(plotly)

#head(df)

As of the date of collection of this data, the overall U.S. population that is fully vaccinated is 61.7%. According to the Mayo Clinic vaccine tracker site, vaccine progress is updated daily.

# create hover text
df$hover <- with(df, paste(State, '<br>', "Fully vaccinated: ",Fully.vaccinated,"%", sep = "",                         '<br>', "Population:", Population))
# set the color and width of state borders
l <- list(color = toRGB("white"), width =2)

# specify your map projections
m <- list(scope = "usa", projection = list(type= "albers usa"), showlakes = FALSE)


plot_geo(df, locationmode = "USA-states") %>%
    add_trace(z = ~Fully.vaccinated,
              zmin = min(df$Fully.vaccinated),
              zmax = max(df$Fully.vaccinated),
              text = ~hover,
              hoverinfo = ('text'),
              locations = ~Code, #marker = list(line= l),
              color= ~Fully.vaccinated,
              colors = 'Purples') %>%
    colorbar(title = "vaccination (%)") %>%
    layout(title = "Percentage of Fully Vaccinated by State",
           geo = m
           )

Fully vaccinated. This is the percentage of people in the selected population (by state or United States) who are fully vaccinated. This includes people who have had one dose of the Janssen/Johnson & Johnson vaccine or two doses of the Pfizer-BioNTech vaccine or Moderna.

library(DT)
DT::datatable(df[-6])