![]() ![]() Petal_lm_surface$Petal.Length <- predict.lm(petal_lm, newdata = petal_lm_surface) Petal_lm_surface <- id(Sepal.Length = axis_x,Sepal.Width = axis_y, = F) #Graph Resolution (more important for more complex shapes)Īxis_x <- seq(min(my_df$Sepal.Length), max(my_df$Sepal.Length), by = graph_reso)Īxis_y <- seq(min(my_df$Sepal.Width), max(my_df$Sepal.Width), by = graph_reso) I chose to sample every 0.05 points, and use the extent of the data set as my limits. The following sets up the extent of our surface. ![]() Petal_lm <- lm(Petal.Length ~ 0 + Sepal.Length + Sepal.Width,data = my_df) This creates a surface similar to the volcano object which you can then add to your plot. You need to sample the points based on the predict object created from your lm call.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |