I'm not totally sure what you mean by a chart type style of group, but for stacked and regular bar chats, the following should work for you;
library(plotly)
Animals <- c("giraffes", "orangutans", "monkeys")
SF_Zoo <- c(20, 14, 23)
LA_Zoo <- c(12, 18, 29)
data <- data.frame(Animals, SF_Zoo, LA_Zoo)
layout_types <- list(
type = "buttons",
direction = "right",
xanchor = 'center',
yanchor = "top",
pad = list('r'= 0, 't'= 10, 'b' = 10),
x = 0.5,
y = 1.27,
buttons = list(
list(method = "relayout",
args = list("barmode", "bar"),
label = "Bar"),
list(method = "relayout",
args = list("barmode", 'stack'),
label = "Stack")
))
p <- plot_ly(data, x = ~Animals, y = ~SF_Zoo, type = 'bar', name = 'SF Zoo') %>%
add_trace(y = ~LA_Zoo, name = 'LA Zoo')%>% layout(updatemenus = list(layout_types))
p

Here's great guidance on dealing with buttons