Subset a visreg object
subset-visreg.Rd
Subset a visreg object so that only a portion of the full model is plotted.
Usage
# S3 method for visreg
subset(x, sub, ...)
Examples
# Fit a model and construct a visreg object
airquality$Heat <- cut(airquality$Temp,3,labels=c("Cool","Mild","Hot"))
fit <- lm(Ozone~ Solar.R + Wind*Heat,data=airquality)
v <- visreg(fit, "Wind", by="Heat", plot=FALSE)
# Plot only certain levels
vv <- subset(v, Heat %in% c("Cool", "Hot"))
plot(vv)
# Plot only up to wind 15 mph
vv <- subset(v, Wind < 15)
plot(vv)