# NOT RUN {
# simple example
ggiris <- qplot(Petal.Width, Sepal.Length, data = iris, color = Species)
ggplotly(ggiris)
data(canada.cities, package = "maps")
viz <- ggplot(canada.cities, aes(long, lat)) +
borders(regions = "canada") +
coord_equal() +
geom_point(aes(text = name, size = pop), colour = "red", alpha = 1/2)
ggplotly(viz, tooltip = c("text", "size"))
# highlighting lines
demo("highlight-ggplotly", package = "plotly")
# client-side linked brushing
library(crosstalk)
d <- SharedData$new(mtcars)
subplot(
qplot(data = d, x = mpg, y = wt),
qplot(data = d, x = mpg, y = vs)
)
# client-side linked brushing in a scatterplot matrix
SharedData$new(iris) %>%
GGally::ggpairs(aes(colour = Species), columns = 1:4) %>%
ggplotly(tooltip = c("x", "y", "colour"))
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab