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.
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", …)
A 2-way table or matrix.
The minimum acceptable value of Kendall's tau, Cohen's Kappa or WBCI. Defaults to the criterion of the input matrix x
.
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.
The number of splits to make. tau0
is ignored.
The maximum number of splits.
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)
.
proportion of the gaps between rows/columns.
floor censored zooming: all cases will be plotted but only those with a frequency of at least floor
will be considered for the clustering.
revert the y axis.
Whether to make a new plot or to add to an existing one.
The shape of the objects. See fluctile.
See fluctile.
See fluctile.
Whether or not to create a plot via fluctile
.
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) . |
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
.
Whether or not to draw labels.
Label options, see fluctile.
Color(s) for the tiles, see fluctile.
Border color for the tiles. Can also be a matrix.
Color for the background of the cells, see fluctile.
dots
invisible(TRUE)
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
.
# NOT RUN {
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 )
# }
Run the code above in your browser using DataLab