Learn R Programming

EFAtools (version 0.8.0)

print.LOADINGS: Print LOADINGS object

Description

Print LOADINGS object

Usage

# S3 method for LOADINGS
print(
  x,
  cutoff = 0.3,
  digits = 3,
  max_name_length = 10,
  h2 = NULL,
  color = TRUE,
  name_style = c("truncate", "abbreviate", "full"),
  max_factor_name_length = NULL,
  max_factors_per_block = NULL,
  sort_loadings = c("none", "primary", "clustered"),
  legend = FALSE,
  ...
)

# S3 method for LOADINGS format(x, ...)

Arguments

x

class LOADINGS matrix.

cutoff

numeric. The number above which to print loadings in bold default is .3.

digits

numeric. Passed to round. Number of digits to round the loadings to (default is 3).

max_name_length

numeric. The maximum length of the variable names to display. Everything beyond this will be cut from the right unless name_style = "abbreviate" or name_style = "full" is used.

h2

numeric. Vector of communalities to print. If named and x has row names, names are used to align communalities to rows.

color

logical. Whether to apply console styling using cli. Default is TRUE.

name_style

character. How to shorten variable names longer than max_name_length. "truncate" cuts names from the right, "abbreviate" uses base::abbreviate(), and "full" prints full names.

max_factor_name_length

numeric or NULL. Optional maximum length of factor names. If NULL, factor names are not shortened.

max_factors_per_block

numeric or NULL. Maximum number of factor columns to print per block. If NULL, the number is chosen from the console width.

sort_loadings

character. Optional row sorting. "none" preserves the input order, "primary" groups rows by the factor with the largest absolute loading, and "clustered" additionally sorts within each factor by the size of the primary loading.

legend

logical. Whether to append a short explanation of the styling. Default is FALSE for standalone loading matrices.

...

additional arguments passed to print or format

Details

The method prints a loading matrix in a compact, console-oriented table. Loadings with absolute value greater than or equal to cutoff are emphasized, smaller loadings are de-emphasized, and Heywood-relevant communality/ uniqueness values are marked when h2 is supplied. Long variable names can be truncated, abbreviated, or printed in full. If the matrix has many factor columns, the table is split into column blocks so that the output remains readable in narrower consoles.

If h2 is named and x has row names, h2 is matched to the row names of x before any optional row sorting is applied. If x has no row names, a named h2 vector is used in the supplied order.

Examples

Run this code
EFAtools_PAF <- EFA(test_models$baseline$cormat, n_factors = 3, N = 500,
                    type = "EFAtools", method = "PAF", rotation = "promax")
EFAtools_PAF

Run the code above in your browser using DataLab