data(diamonds, package = "ggplot2")
set.seed(42)
idx <- sample(nrow(diamonds), 1e4)
mid <- interpret(price ~ (carat + cut + color + clarity)^2, diamonds[idx, ])
# Plot a quantitative main effect
plot(mid, "carat")
# Plot a qualitative main effect
plot(mid, "clarity")
# Plot an interaction effect with data points and a raster layer
plot(mid, "carat:clarity", type = "compound", data = diamonds[idx, ])
# Use a different color theme
plot(mid, "clarity:color", theme = "RdBu")
Run the code above in your browser using DataLab