This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Makes plot of either mpg or hp versus wt using mtcars dataset | |
## Dropdown enables toggling between what variable to plot on y axis | |
library(plotly) | |
plot_ly(mtcars, x = ~wt) %>% | |
add_markers(y = ~mpg, name = "mpg") %>% | |
add_markers(y = ~hp, name = "hp", visible = FALSE) %>% | |
layout( | |
title = "Drop down menus - Update", | |
xaxis = list(domain = c(0.1, 1)), |
OlderNewer