spm is an abbreviation for scatterplot.matrix.
This function just sets up a call to pairs.scatterplot.matrix(x, ...)
## S3 method for class 'formula':
scatterplot.matrix(formula, data=NULL, subset, ...)
## S3 method for class 'default':
scatterplot.matrix(x, labels=colnames(x),
diagonal=c("density", "boxplot", "histogram", "qqplot", "none"),
adjust=1, nclass, plot.points=TRUE, smooth=TRUE, span=0.5, reg.line=lm,
transform=FALSE, ellipse=FALSE, levels=c(.5, .9), robust=FALSE,
groups=FALSE, by.groups=FALSE, col=palette(),
pch=1:n.groups, lwd=1,
cex=par("cex"), cex.axis=par("cex.axis"), cex.labels=NULL,
cex.main=par("cex.main"),
legend.plot=length(levels(groups)) > 1, ...)
spm(x, ...)~ x1 + x2 + ... + xk or ~ x1 + x2 + ... + xk | z where z
evaluates to a factor or other variable to divide the data into groups.scatterplot.matrix.formula,
a data frame within which to evaluate the formula.density function.hist
function.TRUE the points are plotted in each
off-diagonal panel.TRUE a lowess smooth is plotted in each
off-diagonal panel.FALSE a line is plotted using the
function given by this argument; e.g., using rlm in
package MASS plots a robust-regression line.TRUE, multivariate normalizing Box-Cox transformations
are computed and plotted; if a vector of powers, one for each variable, these are applied
as Box-Cox power transformations prior to plotting.TRUE data-concentration ellipses are plotted in
the off-diagonal panels.c(.5, .9).TRUE use the cov.trob function in the MASS package
to calculate the center and covariance matrix for the data ellipse.TRUE, regression lines are fit by groups.par).par).TRUE then a legend for the groups is plotted
in the bottom-right cell.NULL. This function is used for its side effect: producing
a plot.pairs, scatterplot,
data.ellipse, box.cox.powers,
box.cox, cov.trob.data(Duncan)
scatterplot.matrix(~income + education + prestige | type, data=Duncan)
scatterplot.matrix(~income + education + prestige,
transform=TRUE, data=Duncan)Run the code above in your browser using DataLab