chrn_labels <- c(
  'Severe Chronic Absenteeism' = "Severe",
  'Moderate Chronic Absenteeism' = "Moderate",
  'At-Risk of Chronic Absenteeism' = "At-Risk",
  'Not At-Risk of Chronic Absenteeism' = "Not At-Risk"
)

results_factor2 <- results_factor %>%
  select(last_name, first_name, year, abs_levels)

m <- highlight_key(results_factor2)
p <- ggplot(m,
       mapping = aes(x = year, y = length(last_name), fill = abs_levels)) +
  geom_col() +
  facet_wrap(~abs_levels, labeller = as_labeller(chrn_labels)) +
  scale_fill_viridis_d() +
  scale_x_discrete(labels = NULL) +
  scale_y_continuous(labels = NULL) +
  labs(x = NULL, y = NULL,
       title = "2019-2020 Overall Levels of Chronic Absenteeism") +
  theme_minimal() +
  theme(legend.position="none")
gg <- highlight(ggplotly(p), "plotly_selected")
crosstalk::bscols(gg, DT::datatable(m, 
                                    colnames = c(
                                      'Last Name', 'First Name', 'Year', 'Level'),
                                    extensions = 'Buttons', 
                                    options = list(
                                      dom = 'Bfrtip',
                                      buttons = c('copy', 'csv', 'pdf', 
                                                  'print')
                                      )))