Here is the R code for 2 of the plots on earlier slides. Code for Plotly tends to be more involved.
GGPlot example
g <- ggplot(Orange, aes(x= age, y=circumference)) + geom_point()
g + geom_smooth(method="lm", level = 0.99) + coord_cartesian(ylim = c(0,250))
Plotly Example
mod <- lm(mpg ~ wt, data=mtcars)
x = mtcars$wt; y = mtcars$mpg
xax <- list(title = "Weight", titlefont = list(family="Modern Computer Roman"))
yax <- list(title = "Miles per Gallon", titlefont = list(family="Modern Computer Roman"),
range = c(0,35))
fig <- plot_ly(x=x, y=y, type="scatter", mode = "markers", name = "data") %>%
add_lines(x=x, y=fitted(mod), name="fitted") %>%
layout(xaxis = xax, yaxis = yax) %>%
layout(margin=list(l=150, r=50, b=20, t=40))
config(fig, displaylogo=FALSE)