Plots a Bertin diagram.
Usage
plot_bertin(object, ...)
# S4 method for matrix
plot_bertin(object, threshold = NULL, scale = NULL)
# S4 method for data.frame
plot_bertin(object, threshold = NULL, scale = NULL)
Arguments
- object
A \(m \times p\)
numeric
matrix
ordata.frame
of count data (absolute frequencies giving the number of individuals for each class).- ...
Currently not used.
- threshold
A
function
that takes a numeric vector as argument and returns a numeric threshold value (see below). IfNULL
(the default), no threshold is computed.- scale
A
function
used to scale each variable, that takes a numeric vector as argument and returns a numeric vector. IfNULL
(the default), no scaling is performed.
Value
A ggplot2::ggplot object.
Bertin Matrix
As de Falguerolles et al. (1997) points out: "In abstract terms, a Bertin matrix is a matrix of displays. ... To fix ideas, think of a data matrix, variable by case, with real valued variables. For each variable, draw a bar chart of variable value by case. High-light all bars representing a value above some sample threshold for that variable."
References
Bertin, J. (1977). La graphique et le traitement graphique de l'information. Paris: Flammarion. Nouvelle Bibliothèque Scientifique.
de Falguerolles, A., Friedrich, F. & Sawitzki, G. (1997). A Tribute to J. Bertin's Graphical Data Analysis. In W. Badilla & F. Faulbaum (eds.), SoftStat '97: Advances in Statistical Software 6. Stuttgart: Lucius & Lucius, p. 11-20.
See also
Other plot methods:
matrigraph()
,
plot_diceleraas()
,
plot_diversity
,
plot_ford()
,
plot_heatmap()
,
plot_rank()
,
plot_spot()
,
seriograph()
Examples
## Data from Lipo et al. 2015
data("mississippi", package = "folio")
## Plot a Bertin diagram...
## ...without threshold
plot_bertin(mississippi)
## ...with variables scaled to 0-1 and the variable mean as threshold
scale_01 <- function(x) (x - min(x)) / (max(x) - min(x))
plot_bertin(mississippi, threshold = mean, scale = scale_01)