loadings_plot: Factor loadings plot

Description Usage Arguments Value Examples

Description

Creates a factor loading plot. Essentially a heatmap built on top of gplot::heatmap.2. UNDER HEAVY DEVELOPMENT.

Usage

1
2
loadings_plot(loadings, colorbreaks = c(0, 0.2, 0.4, 0.6, 0.8, 1),
  colors = NA, columnlabels = NA, labRow = NA, xlab = NA)

Arguments

loadings

factor loadings

colorbreaks

cutpoints of the discontinuous factor loading colors

colors

a prespecified vector of colors corresponding to colorbreaks.

columnlabels

x-axis labels (typically more discriptive variable names)

labRow

Names of factors (defaults to factor 1, factor 2, etc.)

xlab

x-axis label

Value

A graphic of factor loadings.

Examples

1
2
3
4
5
6
7
8
9
library(datasets)
corr.matrix <- cor(mtcars)
results <- psych::fa(corr.matrix, 5, rotate = "varimax")
loadings_plot(loadings = results$loadings,
              colorbreaks = c(0, 0.2, 0.4, 0.6, 0.8,1),
              colors = NA,
              columnlabels = colnames(mtcars),
              labRow = NA,
              xlab = "Variables")

mattkcole/FAtools documentation built on May 21, 2019, 1:24 p.m.