rmbmat: Pairwise RMB-Plots

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/rmbmat2.R

Description

This function generates a matrix with RMB-plots of all pairs of variables with a specified target variable. Both categorical 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

1
2
3
4
5
6
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 barcharts.

NOT YET IMPLEMENTED: "rect" or "r" for nested rectangles. "nested.circles" are abbreviated by "nc" or "ncircles".

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="rgb"), c4 = list(col="seq") ) where the plot in row 2 and column 14 is a spineplot, the first row uses RGB colors and the fourth column a sequential color palette. Later arguments overwrite the preceding ones. For instance in the example the plot in row 1 and column 4 will use the sequential color palette.

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.

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.

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.

Author(s)

Alexander Pilhoefer

See Also

rmb, pairs

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
data(olives)


## Not run: 

# 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)

## End(Not run)

extracat documentation built on July 17, 2018, 5:05 p.m.

Related to rmbmat in extracat...