Plots a scatterplot matrix, for which the variables shown horizontally do not necessarily coincide with those shown vertically. If desired, the matrix is divided into several blocks such that it fills more than 1 plot page.
plmatrix(x, y = NULL, data = NULL, panel = NULL,
nrow = NULL, ncol = nrow, reduce = TRUE,
xaxmar=NULL, yaxmar=NULL, xlabmar=NULL, ylabmar=NULL,
xlab=NULL, ylab=NULL, mar=NULL, oma=NULL, diaglabel.csize = NULL,
plargs = NULL, ploptions = NULL, assign = TRUE, ...)
none
data for columns (x axis), or formula defining column variables. If it is a formula containing a left hand side, the left side variables will be used last.
data or formula for rows (y axis). Defaults to x
data.frame containing the variables in case x
or y
is a formula
a function that generates the marks of the individual panels, see Details.
maximum number of rows and columns of panels on a page
if y is not provided and reduce==TRUE
,
the first row and the last column are suppressed.
margin in which the axis (tick marks and
corresponding labels) should be shown: either 1 or 3 for
xaxmar
and 2 or 4 for yaxmar
.
in which margin should the x- [y-] axis be labelled?
not used (introduced to avoid confusion with
xlabmar, ylabmar
)
width of margins, see par
Character expansion for labels appearing in the "diagonal" of the scatterplot matrix (if present)
result of calling pl.control
.
If NULL
, pl.control
will be called to generate it.
If not null, arguments given in ...
will be ignored.
list of pl options.
logical: Should the plargs be stored in the pl.envir
environment?
further arguments passed to the panel
function
and possibly further to functions called by the panel function
Werner A. Stahel, ETH Zurich
The panel
function can be user written. It needs \(>=5\)
arguments which must correspond to the arguments of
plpanel
: x, y, indx, indy, plargs
.
If some arguments are not used, just introduce them as arguments
to the function anyway in order to avoid (unnecessary) error messages
and stops.
Since large scatterplot matrices lead to tiny panels, plmatrix
splits the matrix into blocks of at most nrow
rows and
ncol
columns. If these numbers are missing, they default to
nrow=5
and ncol=6
for landscape pages, and to
nrow=8
and ncol=5
for portrait pages.
The panel
argument defaults to plpanel
, which results
essentially in points
or text
depending on the argument pch
, including a smooth line,
to plmboxes
if 'x' is a factor and 'y' is not or
vice versa,
or to a modification of sunflowers
if both are factors.
The function must have the arguments x
and y
to take the coordinates of the points and may have the arguments
indx
and indy
to transfer the variables\' index.
If there is an argument plargs
, the current value of
plargs
will be passed on. It is a list and can be extended
to pass any additional items to the function.
pairs
, plyx
plmatrix(iris, pch=as.numeric(Species))
plmatrix(~Sepal.Length+Sepal.Width, ~Petal.Length+Petal.Width,
data=iris, smooth=TRUE, plab=substr(Species,1,2))
Run the code above in your browser using DataLab