View source: R/utility_functions.R
extract_category_quant_plot | R Documentation |
Plot of the projection of the category quantification into the loading vector for non-linear pca variables of an object of the class "princals".
extract_category_quant_plot( pca, pca_data, var, plot_dim = c(1, 2), nudge_y = 0, nudge_x = 0 )
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. 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. |
Returns a list ggplot2 object, one per each specified variable
Abel Torres Espin
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
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
data(mtcars) pca_mtcars<-Gifi::princals(mtcars) extract_category_quant_plot(pca = pca_mtcars, pca_data = mtcars, var="cyl"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.