I have two plots that are identical except for the colour referenced in aes(). I would like to use plotly to toggle between the two plots' color schemes. How might I do this?
require(ggplot2)
require(plotly)
#DF Construction
col1 <- c(84, 55, 69, 65, 80, 67, 90, 75, 89, 88)
col2 <- c(81, 70, 88, 78, 77, 72, 88, 79, 88, 90)
col3 <- c("L2", "L1", "L2", "L1", "L1", "L2", "L1", "L2", "L2", "L2")
col4 <- c("Ready", "Not", "Not", "Not", "Not", "Not", "Ready", "Not", "Ready", "Ready")
df <- data.frame(col1, col2, col3, col4)
#ggplot Construction
plot1 <- ggplot(df, aes(x = col1, y = col2, colour = col3)) +
geom_jitter()
plot2 <- ggplot(df, aes(x = col1, y = col2, colour = col4)) +
geom_jitter()
#Plotly Toggle
???