Usage
sjp.corr(data, title = NULL, axis.labels = NULL, type = c("circle", "tile"), sort.corr = TRUE, decimals = 3, na.deletion = c("listwise", "pairwise"), corr.method = c("spearman", "pearson", "kendall"), geom.colors = "RdBu", geom.size = 15, wrap.title = 50, wrap.labels = 20, show.legend = FALSE, legend.title = NULL, show.values = TRUE, show.p = TRUE, p.numeric = FALSE, prnt.plot = TRUE)
Arguments
data
matrix with correlation coefficients as returned by the
cor
-function, or a data.frame
of variables where
correlations between columns should be computed. title
character vector, used as plot title. Depending on plot type and function,
will be set automatically. If title = ""
, no title is printed.
axis.labels
character vector with labels used as axis labels. Optional
argument, since in most cases, axis labels are set automatically.
type
indicates whether the geoms of correlation values should be plotted
as "circle"
(default) or as "tile"
.
sort.corr
logical, if TRUE
(default), the axis labels are sorted
according to the correlation strength. If FALSE
, axis labels
appear in order of how variables were included in the cor-computation or
data frame.
decimals
indicates how many decimal values after comma are printed when
the values labels are shown. Default is 3. Only applies when
show.values = TRUE
.
na.deletion
indicates how missing values are treated. May be either
"listwise"
(default) or "pairwise"
. May be
abbreviated.
corr.method
indicates the correlation computation method. May be one of
"spearman"
(default), "pearson"
or "kendall"
.
May be abbreviated.
geom.colors
user defined color for geoms. See 'Details' in sjp.grpfrq
. geom.size
size resp. width of the geoms (bar width, line thickness or point size,
depending on plot type and function). Note that bar and bin widths mostly
need smaller values than dot sizes.
wrap.title
numeric, determines how many chars of the plot title are displayed in
one line and when a line break is inserted.
wrap.labels
numeric, determines how many chars of the value, variable or axis
labels are displayed in one line and when a line break is inserted.
show.legend
logical, if TRUE
, and depending on plot type and
function, a legend is added to the plot.
legend.title
character vector, used as title for the plot legend.
show.values
logical, whether values should be plotted or not.
show.p
logical, adds significance levels to values, or value and
variable labels.
p.numeric
logical, if TRUE
, the p-values are printed
as numbers. If FALSE
(default), asterisks are used.
prnt.plot
logical, if TRUE
(default), plots the results as graph. Use FALSE
if you don't
want to plot any graphs. In either case, the ggplot-object will be returned as value.