# NOT RUN {
library(tidyr)
library(purrr)
library(rbokeh)
iris %>%
nest(-Species) %>%
mutate(mod = map(data, ~ lm(Sepal.Length ~ Sepal.Width, data = .x))) %>%
panels_by_row(function(x) {
figure(xlab = "Sepal.Width", ylab = "Sepal.Length") %>%
ly_points(x$data[[1]]$Sepal.Width, x$data[[1]]$Sepal.Length) %>%
ly_abline(x$mod[[1]])
}) %>%
trelliscope(name = "iris")
# }
Run the code above in your browser using DataLab