correlationPlot | R Documentation |
Visualize the correlations between topics stored in a matrix, typically one
returned via getCorrMtx()
. This function uses ggplot2::geom_tile.
correlationPlot(
mat,
colLabs = NA,
rowLabs = NA,
title = NA,
annotation = FALSE
)
mat |
matrix with correlation values from -1 to 1 |
colLabs |
x-axis label for plot. These are the columns of the matrix, or specifically m2 from getCorrMtx. (default: NULL) |
rowLabs |
y-axis label for plot. These are the rows of the matrix, or specifically m1 from getCorrMtx. (default: NULL) |
title |
title of the plot. (default: NULL) |
annotation |
Boolean to show the correlation values in the squares of the heatmap (default; FALSE) |
a heatmap of the values in the input mat
data(mOB)
pos <- mOB$pos
cd <- mOB$counts
counts <- cleanCounts(cd, min.lib.size = 100)
corpus <- restrictCorpus(counts, removeAbove=1.0, removeBelow = 0.05)
ldas <- fitLDA(t(as.matrix(corpus)), Ks = 3)
optLDA <- optimalModel(models = ldas, opt = 3)
results <- getBetaTheta(optLDA, perc.filt = 0.05, betaScale = 1000)
deconProp <- results$theta
corMtx <- getCorrMtx(m1 = as.matrix(deconProp), m2 = as.matrix(deconProp), type = "t")
rownames(corMtx) <- paste0("X", seq(nrow(corMtx)))
colnames(corMtx) <- paste0("X", seq(ncol(corMtx)))
correlationPlot(mat = corMtx, title = "Proportional correlation", annotation = TRUE) +
ggplot2::theme(axis.text.x = ggplot2::element_text(angle = 90, vjust = 0))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.