Creating a filter on a boxplot from ggplot object

Hi,

I am trying to turn my ggplot boxplot into an interactive plotly graph. I currently use a filtered dataset as there is 55 unique categories in the dataset, however, I would really like to be able to use a filter dropdown menu to transform the boxplot between all 55 categories so others could see information for all categories that they wish.

My current attempt at the code is below:

ggplotly(all.p1,
transforms = list(
list(
type = “filter”,
target = ICD_Grouping,
operation = “=”,
value = unique(dbdata$ICD_Grouping)[1]
))) %>%
layout(updatemenus = list(
list(
type = “dropdown”,
active = 1,
buttons = list(
list(method = “update”,
args = list(“transforms[0].value”, unique(dbdata$ICD_Grouping)[1]),
label = unique(dbdata$ICD_Grouping)[1]),
list(method = “update”,
args = list(“transforms[0].value”, unique(dbdata$ICD_Grouping)[2]),
label = unique(dbdata$ICD_Grouping)[2]),
list(method = “update”,
args = list(“transforms[0].value”, unique(dbdata$ICD_Grouping)[3]),
label = unique(dbdata$ICD_Grouping)[3]))
)
)
)