File: sjp.corr.Rd

package info (click to toggle)
r-cran-sjplot 2.8.17%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,596 kB
  • sloc: sh: 13; makefile: 2
file content (96 lines) | stat: -rw-r--r-- 3,798 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/sjPlotCorr.R
\name{sjp.corr}
\alias{sjp.corr}
\title{Plot correlation matrix}
\usage{
sjp.corr(
  data,
  title = NULL,
  axis.labels = NULL,
  sort.corr = TRUE,
  decimals = 3,
  na.deletion = c("listwise", "pairwise"),
  corr.method = c("pearson", "spearman", "kendall"),
  geom.colors = "RdBu",
  wrap.title = 50,
  wrap.labels = 20,
  show.legend = FALSE,
  legend.title = NULL,
  show.values = TRUE,
  show.p = TRUE,
  p.numeric = FALSE
)
}
\arguments{
\item{data}{Matrix with correlation coefficients as returned by the
\code{\link{cor}}-function, or a \code{data.frame} of variables where
correlations between columns should be computed.}

\item{title}{character vector, used as plot title. Depending on plot type and function,
will be set automatically. If \code{title = ""}, no title is printed.
For effect-plots, may also be a character vector of length > 1,
to define titles for each sub-plot or facet.}

\item{axis.labels}{character vector with labels used as axis labels. Optional
argument, since in most cases, axis labels are set automatically.}

\item{sort.corr}{Logical, if \code{TRUE} (default), the axis labels are sorted
according to the correlation strength. If \code{FALSE}, axis labels
appear in order of how variables were included in the cor-computation or
data frame.}

\item{decimals}{Indicates how many decimal values after comma are printed when
the values labels are shown. Default is 3. Only applies when
\code{show.values = TRUE}.}

\item{na.deletion}{Indicates how missing values are treated. May be either
\code{"listwise"} (default) or \code{"pairwise"}. May be
abbreviated.}

\item{corr.method}{Indicates the correlation computation method. May be one of
\code{"pearson"} (default), \code{"spearman"} or \code{"kendall"}.
May be abbreviated.}

\item{geom.colors}{user defined color for geoms. See 'Details' in \code{\link{plot_grpfrq}}.}

\item{wrap.title}{numeric, determines how many chars of the plot title are displayed in
one line and when a line break is inserted.}

\item{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.}

\item{show.legend}{logical, if \code{TRUE}, and depending on plot type and
function, a legend is added to the plot.}

\item{legend.title}{character vector, used as title for the plot legend.}

\item{show.values}{Logical, whether values should be plotted or not.}

\item{show.p}{Logical, adds significance levels to values, or value and
variable labels.}

\item{p.numeric}{Logical, if \code{TRUE}, the p-values are printed
as numbers. If \code{FALSE} (default), asterisks are used.}
}
\value{
(Insisibily) returns the ggplot-object with the complete plot (\code{plot}) as well as the data frame that
          was used for setting up the ggplot-object (\code{df}) and the original correlation matrix
          (\code{corr.matrix}).
}
\description{
Plot correlation matrix as ellipses or tiles.
}
\details{
Required argument is either a \code{\link{data.frame}} or a matrix with correlation coefficients
           as returned by the \code{\link{cor}}-function. In case of ellipses, the
           ellipses size indicates the strength of the correlation. Furthermore,
           blue and red colors indicate positive or negative correlations, where
           stronger correlations are darker.
}
\note{
If \code{data} is a matrix with correlation coefficients as returned by
      the \code{\link{cor}}-function, p-values can't be computed.
      Thus, \code{show.p} and \code{p.numeric}
      only have an effect if \code{data} is a \code{\link{data.frame}}.
}