0

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)) 
dpel
  • 1,954
  • 1
  • 21
  • 31
Tom O
  • 1,497
  • 3
  • 13
  • 16
  • How were you planning to make the chart interactive without using Shiny? – divibisan May 18 '18 at 13:29
  • Yeah, was wondering if there was a way to do this without shiny. Was hoping to share this w somebody using powerbi – Tom O May 18 '18 at 14:11
  • 1
    try the "manipulate" package. https://support.rstudio.com/hc/en-us/articles/200551906-Interactive-Plotting-with-Manipulate – Nova May 18 '18 at 14:14
  • the `crosstalk` package may be helpful if you use plotly: https://rstudio.github.io/crosstalk/ – zack May 18 '18 at 14:48

0 Answers0