knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
This is a basic example which shows you how to use lbjdata's highcharter theme. First, load the packages:
library(lbjdata) library(tidyverse) library(janitor) library(highcharter)
Then, import some data:
provider_types <- read_csv("https://genesis.soc.texas.gov/files/accessibility/vaccineprovideraccessibilitydata.csv") %>% clean_names() %>% group_by(type) %>% summarise(tot_shipped = sum(total_shipped), tot_avail = sum(vaccines_available)) %>% drop_na() %>% arrange(desc(tot_shipped))
Then, draw a chart with highcharter and add the theme:
provider_types %>% hchart("column", hcaes(x=type, y = tot_shipped, colors=type), name = "Total Shipped: ") %>% hc_title(text="Vaccine Supply, By Type of Provider") %>% hc_subtitle(text="Source: Texas Department of State Health Services") %>% hc_add_theme(hc_theme_lbj())
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.