# NOT RUN {
if(require(plotly)) {
manipulateWidget(
{
plot_ly(iris, x = ~Sepal.Length, y = ~Sepal.Width,
color = ~Species, type = "scatter", mode = "markers") %>%
layout(showlegend = legend)
},
legend = mwCheckbox(TRUE, "Show legend")
)
}
# }
Run the code above in your browser using DataCamp Workspace