View source: R/print.efa_compare.R
| print.efa_compare | R Documentation |
print() shows a summarised output of the efa_compare() function: the mean
(with its range), median, and root mean squared distance (RMSE) of the
differences, the number of decimals to which all numbers agree, the minimum
number of decimals provided, and (for matrices) the number of differing
indicator-to-factor correspondences, followed (optionally) by the table of
elementwise differences. format() assembles the same report and returns it
as a character vector; print() is cat(format(x), sep = "\n").
The lines follow the active console theme, so they are plain when colours are
disabled (for example when captured into a file or stripped with
cli::ansi_strip()).
## S3 method for class 'efa_compare'
print(x, ...)
## S3 method for class 'efa_compare'
format(
x,
digits = NULL,
m_red = NULL,
range_red = NULL,
round_red = NULL,
print_diff = NULL,
...
)
x |
An object of class |
... |
Passed from |
digits, m_red, range_red, round_red, print_diff |
Display controls, documented
in |
The line reporting the minimum number of decimals provided is shown only when it carries information: two ordinary double matrices carry the full double precision, for which the count is uninformative and the line is omitted.
The summary statistics are absolute differences, so they carry no direction. The
elementwise differences are signed, and the table is headed by the direction of the
subtraction, named with the x_labels recorded by efa_compare() ("x" and "y" by
default): a negative cell means the first solution is the lower of the two there.
print() returns its argument x invisibly. format() returns a
character vector with the report lines.
# 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
comp <- efa_compare(EFA_SPSS_5$unrot_loadings, EFA_psych_5$unrot_loadings,
x_labels = c("SPSS", "psych"))
comp
# format() returns the same lines as a character vector:
writeLines(format(comp))
# the display settings can be changed without recomputing the comparison:
print(comp, digits = 2, print_diff = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.