#' Correlation plot for data
#'
#'
#' @param pearsoncorr person correlation matrix
#'
#' @details Please see \link[corrplot]{corrplot}
#'
#' @examples
#' library(Hmisc)
#' data(corrplot_data)
#' tmpDataset <- as.matrix(corrplot_data);
#' tmpPearsonCorr <- Hmisc::rcorr(tmpDataset,type="pearson");
#' tmpPearsonMat <- tmpPearsonCorr$r;
#' diag(tmpPearsonMat) <- 0;
#' tmpPearsonMat[lower.tri(tmpPearsonMat)] <- 0;
#' tmpCorrplot <- genericcorrplot(tmpPearsonCorr,title="Pearson correlation analysis");
#'
#'
#' @name genericcorrplot
#' @rdname genericcorrplot
#' @export
#'
genericcorrplot <- function(pearsoncorr,
title = "Correlation map",
method = "circle",
type = "upper",
add = FALSE,
col = grDevices::colorRampPalette(c("blue","white","red"))(200),
bg = "white",
is.corr = TRUE,
diag = FALSE,
outline = TRUE,
oma = c (0,0,0,0),
mar = c(0,0,2,0),
addgrid.col = NULL,
addCoef.col = NULL,
addCoefasPercent = FALSE,
order = "original",
tl.pos = "td",
tl.cex = 0.75,
tl.col = "black",
tl.offset = 0.4,
tl.srt = 55,
cl.pos = NULL,
cl.lim = NULL,
cl.length = NULL,
cl.cex = 0.8,
cl.ratio = 0.15,
cl.align.text = "c",
cl.offset = 0.5,
number.cex = 0.7,
addshade = c("negative", "positive", "all"),
shade.lwd = 1,
shade.col = "white",
p.mat = pearsoncorr$P ,
sig.level = 0.05,
insig = "blank",
pch = 6,
pch.col = "black",
pch.cex = 2,
plotCI = "n",...
)
{
tmpCorrplot <- corrplot:::corrplot(pearsoncorr$r,
title = title,
method = method,
type = type,
add = add,
col = col,
bg = bg,
is.corr = is.corr,
diag = diag,
outline = outline,
oma = oma,
mar = mar,
addgrid.col = addgrid.col,
addCoef.col = addCoef.col,
addCoefasPercent = addCoefasPercent,
order = order,
tl.pos = tl.pos,
tl.cex = tl.cex,
tl.col = tl.col,
tl.offset = tl.offset,
tl.srt = tl.srt,
cl.pos = cl.pos,
cl.lim = cl.lim,
cl.length = cl.length,
cl.cex = cl.cex,
cl.ratio = cl.ratio,
cl.align.text = cl.align.text,
cl.offset = cl.offset,
number.cex = number.cex,
addshade = addshade,
shade.lwd = shade.lwd,
shade.col = shade.col,
p.mat = p.mat ,
sig.level = sig.level,
insig = insig,
pch = pch,
pch.col = pch.col,
pch.cex = pch.cex,
plotCI = plotCI,...);
return(tmpCorrplot)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.