% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plot.efa_compare.R
\name{plot.efa_compare}
\alias{plot.efa_compare}
\title{Plot efa_compare object}
\usage{
\method{plot}{efa_compare}(x, plot_red = NULL, ...)
}
\arguments{
\item{x}{list. An object of class \code{efa_compare} (output from the
\code{\link[=efa_compare]{efa_compare()}} function).}

\item{plot_red}{numeric or \code{NULL}. Threshold above which to draw the absolute
differences in red, documented in \code{\link[=efa_compare]{efa_compare()}}. \code{NULL} (default) uses the
value recorded in \code{x$settings}; supplying one overrides it for this plot only,
so the comparison need not be recomputed to redraw it at another threshold.}

\item{...}{not used.}
}
\value{
A ggplot object showing the absolute differences, with differences
above \code{plot_red} highlighted in red.
}
\description{
Plot method for the \code{\link[=efa_compare]{efa_compare()}} function showing the distribution of the
absolute differences between the two compared objects as a violin plot with
jittered points. Differences above the threshold are highlighted.
}
\examples{
# A type SPSS EFA to mimick the SPSS implementation
EFA_SPSS_5 <- efa_fit(IDS2_R, n_factors = 5,
                      estimate_control = estimate_control(type = "SPSS"),
                      rotate_control = rotate_control(type = "SPSS"))

# A type psych EFA to mimick the psych::fa() implementation
EFA_psych_5 <- efa_fit(IDS2_R, n_factors = 5,
                       estimate_control = estimate_control(type = "psych"),
                       rotate_control = rotate_control(type = "psych"))

# compare the two and plot the differences
comp <- efa_compare(EFA_SPSS_5$unrot_loadings, EFA_psych_5$unrot_loadings,
                    x_labels = c("SPSS", "psych"))
plot(comp)
}
