I'd like to create an interactive chart based on a dplyr
pipe that I've created. I'm not entirely sure if this is doable but would be pretty amazing if it worked.
Here's the code. I'd basically like to have a drop down menu where I can filter the rxid
based on available unique options (commented out).
I'd like to avoid shiny if possible, but i guess can use shiny if needed.
drugname <- c('cipro', 'moxi','tazo')
lhoabx %>%
#filter (rxid %in% 'drugname' ) %>% (drop down menu here?)
group_by (locationid, month) %>%
summarise (totaldot = sum(as.numeric(dot))) %>%
right_join(pdays.summary, by = c('locationid', 'month')) %>%
mutate (totaldot = case_when( is.na(totaldot) ~ 0
,TRUE ~ totaldot )) %>%
mutate(dot1000 = totaldot/totalpdays * 1000) %>%
ggplot (., aes(x = month, y = dot1000)) +
geom_line(aes(linetype = locationid))