Plot the estimated local correlation map (or local partial correlation map) for a pair of variables
corplot(dlg_object, pair = 1, gaussian_scale = FALSE,
plot_colormap = TRUE, plot_obs = FALSE, plot_labels = TRUE,
plot_legend = FALSE, plot_thres = 0, alpha_tile = 0.8,
alpha_point = 0.8, low_color = "blue", high_color = "red",
break_int = 0.2, label_size = 3, font_family = "sans",
point_size = NULL, xlim = NULL, ylim = NULL, xlab = NULL,
ylab = NULL, rholab = NULL, main = NULL, subtitle = NULL)
The density estimation object produced by the dlg-function
Integer indicating which pair of variables you want to plot. The
function looks up the corresponding variables in the bandwidth object used
to calculate the dlg object, and you can inspect this in
dlg_object$bw$joint
. Defaults to 1 (the first pair, usually variable
1 against variable 2).
Logical, if TRUE
the plot is produced on the
marginal standard Gaussian scale.
Logical, if TRUE
the plot includes a colormap to
visualize the value of the local correlation.
Logical, if TRUE
the observations are plotted.
Logical, if TRUE
character labels with local
correlation values are plotted.
Logical, if TRUE
a color legend is plotted.
A number between 0 and 1 indicating the threshold value to be used for not plotting the estimated local correlation in areas with no data. Uses a quick bivariate kernel density estimate a criterion, and skips plotting in areas with kernel density estimate less than the fraction plot_thres of the maximum density estimate. If 0 (default), everything is plotted, if 1 nothing is plotted. Typical values may be in the 0.001-0.01-range.
The alpha-value indicating the transparency of the color tiles. Number between 0 (transparent) and 1 (not transparent).
he alpha-value indicating the transparency of the observations. Number between 0 (transparent) and 1 (not transparent).
The color corresponding to correlation equal to -1 (default: blue).
The color corresponding to correlation equal to 1 (default: red).
Break interval in the color gradient.
Size of text labels, if plotted.
Font family used for text labels, if plotted.
Size of points used for plotting the observations.
x-limits
y-limits
x-label
y-label
Label for the legend, if plotted
Title of plot
Subtitle of plot
This function plots a map of estimated local Gaussian correlations of a
specified pair (defaults to the first pair) of variables as produced by the
dlg-function. This plot is heavily inspired by the local correlation plots
produced by the 'localgauss'-package by Berentsen et. al (2014), but it is
here more easily customized and specially adapted to the ecosystem within the
lg
-package. The plotting is carried out using the ggplot2-package
(Wickham, 2009). This function now also accepts objects created by the
partial_cor()
-function, in order to create local partial
correlation maps.
Berentsen, G. D., Kleppe, T. S., & Tj<U+00F8>stheim, D. (2014). Introducing localgauss, an R package for estimating and visualizing local Gaussian correlation. Journal of Statistical Software, 56(1), 1-18.
H. Wickham. ggplot2: Elegant Graphics for Data Analysis. Springer-Verlag New York, 2009.