Learn R Programming

extracat (version 1.6-3)

rmbmat: Pairwise RMB-Plots

Description

This function generates a matrix with RMB-plots of all pairs of variables with a specified target variable. Both catagorical and numerical variables are accepted and the latter will be binned. This makes the graphic useful for a mixture of variable types and the binning avoids overplotting and color mash as it occurs in (colored) scatterplots of large datasets.

Usage

rmbmat(x, tv, cut = 20, freqvar = NULL, plot.tv = FALSE, num.mode = TRUE,
 mode = "circular", eqwidth = FALSE, freq.trans = "sqrt", innerval = 1,
  allocation = I,max.scale = 1, use.na = FALSE, expected = FALSE,
  model.opt = list(), gap.prop = 0.2, gap.mult = 1.5, col = "hcl", col.opt = list(),
  label = FALSE, label.opt = list(), diag.opt = list(), lower.opt = list(), 
  upper.opt = list(), rc.opt = list(), factor.opt = list(), ...)

Arguments

x
Anything that can be converted to a data.frame via as.data.frame.
tv
The index of the target variable. The target variable will not be plotted unless plot.tv is TRUE.
cut
The number of intervals into which numeric variables will be cut.
freqvar
An optional frequency variable. "Freq" is handled automatically.
plot.tv
Whether or not to include the target variable(s) in the plot.
num.mode
Whether or not to use the numeric mode (no gaps and a numeric axis) for numeric variables.
mode
One of "circular", "pie", "piechart", "p" or "c" for piecharts, "spine" or "s" for spineplots, "bars", "bar" or "b" for barch
eqwidth
See rmb.
freq.trans
See rmb.
innerval
See rmb.
allocation
The widths and heights for the plots are proportional to allocation(nlevels(x)).
max.scale
See rmb.
use.na
See rmb.
expected
See rmb.
model.opt
See rmb.
gap.prop
See rmb.
gap.mult
See rmb.
col
See rmb.
col.opt
See rmb.
label
See rmb.
label.opt
See rmb and details.
diag.opt
A list with rmb parameters. These overwrite the general parameters for all plots on the diagonal.
lower.opt
The same as diag.opt but for the lower triangular matrix. Additionally it is possible to define a second target variable, e.g. lower.opt = list(tv2 = 3, ... ).
upper.opt
The same as diag.opt but for the upper triangular matrix. Additionally it is possible to define a second target variable, e.g. upper.opt = list(tv2 = 3, ... ).
rc.opt
A list with which it is possible to define parameters for single matrix cells (plots), columns or rows. This will overwrite all other parameters for the specified plots. It works like this:

rc.opt = list( r2c12 = list(spine = FALSE), r1 = list(col=

factor.opt
The same as diag.opt, lower.opt, upper.opt but for all pairs of two categorical variables. This overwrites the other option lists.
...
Further parameters.

Value

  • An environment with the parameter lists and matrices. This can be used to update (parts of) the plot without a complete new construction. The update.rmbmat function is under development.

Details

Creates a matrix of all pairwise rmb-plots using all possible rmb parameters except cat.ord, expected =list() and residuals. The parameters are applied to all plots and afterwards possibly overwritten by one of the parameter lists.

See Also

rmb, pairs

Examples

Run this code
data(olives)


# mode = "c" piecharts are currently slow

rmbmat(olives, tv=2, mode = "s")

rmbmat(olives[,1:5], tv=2, col ="div", plot.tv = TRUE,
 lower.opt = list(tv2 = 1, col ="rgb"))

rmbmat(olives[,c(1:5,11)], tv=2,
upper.opt=list(mode="s", eqwidth = TRUE), 
rc.opt = list( c5 = list(eqwidth=FALSE,mode="s"),
r5 = list(eqwidth=TRUE, mode="s")),allocation=NULL)

Run the code above in your browser using DataLab