cfluctile: Pseudo-Diagonal Partitioning for two-way tables

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

View source: R/fluctuations.R

Description

Identifies a diagonal of block-clusters in a two-way table using a top-down-partitioning algorithm then plots the table and adds the clusters as rectangles.

Usage

1
2
3
4
5
6
7
cfluctile(x, tau0 = NULL, method = "Kendall", nsplit = NULL,
                 maxsplit = NULL, trafo = I, gap.prop = 0.2, floor = 0,
                 rev.y = FALSE, add = FALSE, shape = "r", just = "c",
                 dir = "b", plot = TRUE, rect.opt = list(), border =
                 NULL, label = TRUE, lab.opt = list(), tile.col =
                 hsv(0.1, 0.1, 0.1, alpha = 0.6),
                 tile.border = NA, bg.col = "lightgrey", ...)

Arguments

x

A 2-way table or matrix.

tau0

The minimum acceptable value of Kendall's tau, Cohen's Kappa or WBCI. Defaults to the criterion of the input matrix x.

method

Either "Kendall" for Kendall's Tau, "Cohen" for Cohen's Kappa, "WBCI" for the Weighted Bertin Classification Criterion and "s" for the minimum residual method.

nsplit

The number of splits to make. tau0 is ignored.

maxsplit

The maximum number of splits.

trafo

A transformation of the table entries for the plot, but not for the computation of the splits. E.g. trafo = function(z) log(1+z).

gap.prop

proportion of the gaps between rows/columns.

floor

floor censored zooming: all cases will be plotted but only those with a frequency of at least floor will be considered for the clustering.

rev.y

revert the y axis.

add

Whether to make a new plot or to add to an existing one.

shape

The shape of the objects. See fluctile.

just

See fluctile.

dir

See fluctile.

plot

Whether or not to create a plot via fluctile.

rect.opt

A list with optional parameters for the rectangles. Possible parameters are:

col The rectangle color.
lwd The line width. Default is "red".
lty The line type. Default is 1 (solid).
fill The color to fill the rectangles. Defaults is NULL. A sensible choice is for instance alpha(col, 0.1).
border

The white margins around the plot which are also used for the labels. Must be a vector of length 1, 2 or 4 with values in [0, 1]. Default is border = 0.05.

label

Whether or not to draw labels.

lab.opt

Label options, see fluctile.

tile.col

Color(s) for the tiles, see fluctile.

tile.border

Border color for the tiles. Can also be a matrix.

bg.col

Color for the background of the cells, see fluctile.

...

dots

Details

This function calls fluctile to create a 2-way fluctuation diagram and then adds cluster rectangles to it. The cluster rectangles are computed in the following way:

The algorithm cuts the data matrix once horizontally and once vertically and computes a criterion for the 2x2 table consisting of the sums of the four parts that resulted from the cuts. This is done for all possible horizontal and vertical cuts and the best combination is chosen. Then the same procedure is applied to the bottom right submatrix and the top left submatrix. The algorithms stops if no cut yields a better criterion value than tau0.

Value

invisible(TRUE)

Note

This was part of the Google Summer of Code 2011.

Author(s)

Alexander Pilhoefer
Department for Computer Oriented Statistics and Data Analysis
University of Augsburg
Germany

See Also

optile, sortandcut, tfluctile

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
M <- arsim(10000,c(30,40),8, noise = 0.4)
cfluctile( M2 <- optile(M,iter=20) )

cfluctile( M3 <- sortandcut(M) )

cfluctile( M3, nsplit = 4 )

cfluctile( M3, maxsplit = 12 )

cfluctile( M3, tau0 = 0.8 )

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

Related to cfluctile in extracat...