-
|
Beta Was this translation helpful? Give feedback.
Answered by
pbreheny
Jun 9, 2023
Replies: 1 comment 1 reply
-
You're almost there, just apply library(visreg)
fit <- lm(Ozone ~ Solar.R + Wind + Temp + I(Wind^2) + I(Temp^2) +
I(Wind*Temp)+I(Wind*Temp^2) + I(Temp*Wind^2) + I(Temp^2*Wind^2),
data=airquality)
v <- visreg2d(fit, x="Wind", y="Temp", plot=FALSE)
n_colors <- 99
color_palette <- colorRampPalette(c("blue","red"))(n_colors)
zcol <- cut(v$z, n_colors)
plot(v, plot.type="rgl", col=color_palette[zcol]) |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
pbreheny
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You're almost there, just apply
cut()
toz
: