plot.efa_compare: Plot efa_compare object

View source: R/plot.efa_compare.R

plot.efa_compareR Documentation

Plot efa_compare object

Description

Plot method for the 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.

Usage

## S3 method for class 'efa_compare'
plot(x, plot_red = NULL, ...)

Arguments

x

list. An object of class efa_compare (output from the efa_compare() function).

plot_red

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

...

not used.

Value

A ggplot object showing the absolute differences, with differences above plot_red highlighted in red.

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)

EFAtools documentation built on Aug. 21, 2026, 5:16 p.m.