I'm looking to take advantage of the excellent features in Plotly, but it's hard for me to figure out how to add a regression plane to a 3D graphic. Here is an example of how to get started with a 3D plot, does anyone know how to take the next step and add a plane?
library(plotly) data(iris) iris_plot <- plot_ly(my_df, x = Sepal.Length, y = Sepal.Width, z = Petal.Length, type = "scatter3d", mode = "markers") petal_lm <- lm(Petal.Length ~ 0 + Sepal.Length + Sepal.Width, data = iris)
source share