plot.gam(x, y = NULL, residuals = <<see below>>, rugplot = T, se = F, scale = 0, ask = F, ...)
Graphical parameters may also be supplied as arguments to this function (see par).
When ask=T, rather than produce each plot sequentially, plot.gam displays a menu listing all the terms that can be plotted, as well as switches for all the options. The switches displayed in the menu are currently off, they must be selected to turn them on! An additional switch called browser allows users to temporarily regain control, and is useful for setting par options, or for adding additional information to the current plot.
A preplot.gam object is a list of precomputed terms. Each such term (also a preplot.gam object) is a list with components x, y and others---the basic ingredients needed for each term plot. These are in turn handed to the specialized plotting function gplot, which has methods for different classes of the leading x argument. In particular, a different plot is produced if x is numeric, a category or factor, a matrix, or a list. Experienced users can extend this range by creating more gplot methods for other classes.
# create a sample object to plot using the kyphosis dataset gamob <- gam(Kyphosis ~ s(Age) + s(Number), data = kyphosis, family = binomial)plot(gamob, ask = F) # non-interactive version, plots all terms plot(gamob, residuals = T, se = T, rug = F) gamob$preplot <- preplot(gamob) plot(gamob)
# now set ask=T to interact with the menu plot(gamob, ask = T)
# The browser option can be used to change par parameters. # Selecting plot all terms will cause the both plots to flash # by on the screen. To show them both at the same time # select the browser option and type at the prompt: par(mfrow(2,1))
# now the plots should appear in a column when plot all terms # is selected