plmatrix: Scatterplot Matrix

plmatrixR Documentation

Scatterplot Matrix

Description

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.

Usage

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, ...) 

Arguments

x

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.

y

data or formula for rows (y axis). Defaults to x

data

data.frame containing the variables in case x or y is a formula

panel

a function that generates the marks of the individual panels, see Details.

nrow, ncol

maximum number of rows and columns of panels on a page

reduce

if y is not provided and reduce==TRUE, the first row and the last column are suppressed.

xaxmar, yaxmar

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.

xlabmar, ylabmar

in which margin should the x- [y-] axis be labelled?

xlab, ylab

not used (introduced to avoid confusion with xlabmar, ylabmar)

mar, oma

width of margins, see par

diaglabel.csize

Character expansion for labels appearing in the "diagonal" of the scatterplot matrix (if present)

plargs

result of calling pl.control. If NULL, pl.control will be called to generate it. If not null, arguments given in ... will be ignored.

ploptions

list of pl options.

assign

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

Details

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.

Value

none

Note

There are many more arguments, obtained from pl.control, see ?pl.control. These can be passed to plmatrix by an argument plargs that is hidden in the ... argument list.

Author(s)

Werner A. Stahel, ETH Zurich

See Also

pairs, plyx

Examples

plmatrix(iris, pch=as.numeric(Species))
plmatrix(~Sepal.Length+Sepal.Width, ~Petal.Length+Petal.Width,
    data=iris, smooth=TRUE, plab=substr(Species,1,2))

plgraphics documentation built on Oct. 19, 2023, 3 p.m.