Description Usage Arguments Details Note Author(s) References See Also Examples
radioHeat
is a function that provides dedicated heatmapping of a radiomics-based correlation matrix
It can be used to visually assess the elements of a (possibly thresholded) matrix.
It also supports the assessment of collinearity.
1 2 3 |
R |
(regularized) correlation |
lowColor |
A |
highColor |
A |
labelsize |
A |
diag |
A |
threshold |
A |
threshvalue |
A |
values |
A |
textsize |
A |
legend |
A |
main |
A |
This function utilizes ggplot2 (Wickham, 2009) to visualize a matrix as a heatmap: a false color plot in which the individual matrix entries are represented by colors.
lowColor
determines the color scale for matrix entries in the negative range.
highColor
determines the color scale for matrix entries in the positive range.
For the colors supported by the arguments lowColor
and highColor
, see https://stat.columbia.edu/~tzheng/files/Rcolor.pdf.
White entries in the plot represent the midscale value of 0.
One can opt to set the diagonal entries to the midscale color of white when one is interested in (heatmapping) the off-diagonal elements only.
To achieve this, set diag = FALSE
.
Naturally, the diag
argument is only used when the input matrix M
is a square matrix.
The intended usage is to visualize a correlation matrix on radiomic features as a heatmap.
Such a heatmap may be used to support the assessment of strong collinearity or even redundancy amongst the features.
To this end, it is also possible to visualize a thresholded correlation matrix when threshold = TRUE
based on the absolute thresholding value given in the threshvalue
argument (hence the thresholding is done internally).
This enables easier visual access to (blocks of) collinearity in radiomic-feature-based correlation matrices.
While geared towards the visualization of correlation matrices, the function is quite general, in the sense that it can represent any matrix
as a heatmap.
When values = TRUE
and threshold = TRUE
the cell-values are those of the thresholded matrix.
Carel F.W. Peeters <cf.peeters@vumc.nl>
Wickham, H. (2009). ggplot2: elegant graphics for data analysis. New York: Springer.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | ## Generate some (high-dimensional) data
p = 25
n = 10
set.seed(333)
X = matrix(rnorm(n*p), nrow = n, ncol = p)
colnames(X)[1:25] = letters[1:25]
R <- cor(X)
## Visualize the correlation matrix as a heatmap
radioHeat(R)
## Remove diagonal entries from visualization
radioHeat(R, diag = FALSE)
## Additionally, visualize only those entries whose absolute value exceed .5
radioHeat(R, diag = FALSE, threshold = TRUE, threshvalue = .5)
## Additionally, include cell values
radioHeat(R, diag = FALSE, threshold = TRUE, threshvalue = .5,
values = TRUE, textsize = 3)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.