category_quant_plot: Category quantification plot

View source: R/user_functions.R

category_quant_plotR Documentation

Category quantification plot

Description

Plot of the projection of the category quantification into the loading vector for non-linear pca variables of an object of the class "princals".

Usage

category_quant_plot(
  pca,
  pca_data,
  var,
  plot_dim = c(1, 2),
  nudge_y = 0,
  nudge_x = 0
)

Arguments

pca

Object of class prcomp, princals, or data.frame. If object is a prcomp or princals object, pca_data is required, and the loadings will be extracted. If object is a data.frame object, the dataframe needs to be formatted as: first column named Variables and all other columns corresponding to a PC. One row per variable. The values are the loadings.

pca_data

Data passed to the prcomp or princals function.

var

Character vector. Vector with the character name of the variables to plot.

plot_dim

Numeric vector of length 2. Dimensions (aka principal components) to be plotted.

nudge_y

Numeric. Controls y the displacement of the label position for the name of each level.

nudge_x

Numeric. Controls y the displacement of the label position for the name of each level.

Value

Returns a list ggplot2 object, one per each specified variable

Author(s)

Abel Torres Espin

References

  1. Linting, M., Meulman, J. J., Groenen, P. J. F., & van der Koojj, A. J. (2007). Nonlinear principal components analysis: Introduction and application. Psychological Methods, 12(3), 336–358. https://doi.org/10.1037/1082-989X.12.3.336

  2. Linting, M., & Kooij, A. van der. (2012). Nonlinear Principal Components Analysis With CATPCA: A Tutorial. Journal of Personality Assessment, 94(1), 12–25. https://doi.org/10.1080/00223891.2011.627965

Examples

data(mtcars)
pca_mtcars<-Gifi::princals(mtcars)

category_quant_plot(pca = pca_mtcars, pca_data = mtcars, var=c("cyl", "vs"))


ucsf-ferguson-lab/syndRomics documentation built on June 26, 2022, 5:36 p.m.