visreg is an R package for displaying the results of a fitted model in terms of how a predictor variable
x affects an outcome
y. The implementation of visreg takes advantage of object-oriented programming in R, meaning that it works with virtually any type of formula-based model in R provided that the model class provides a
randomForest and many more.
To install the latest release version from CRAN:
To install the latest development version from GitHub:
The basic usage is that you fit a model, for example:
fit <- lm(Ozone ~ Solar.R + Wind + Temp, data=airquality)
and then you pass it to
A more complex example, which uses the
gam() function from mgcv:
A number of options for surface plots are also provided, such as
If your browser supports it, you should be able to interact with above figure (click and drag to rotate).
If you have a question or feature request, please submit an issue.
The documentation provided here focuses on syntax, options, and user interface. For more details on the statistical methodology and implementation, see: