plot_PCA_select: plot_PCA_select: auxiliary function for plot_PCA

plot_PCA_selectR Documentation

plot_PCA_select: auxiliary function for plot_PCA

Description

plot_PCA is a replacement for plot.PCA. plot_PCA_select handles the selection part for plot_PCA: determines for which of the active elements the labels (names) will be printed. Restricting the number of these elements can be useful if the plot contains a lot of elements.

Usage

plot_PCA_select(res, var_ind = "ind", select = NULL, axes = 1:2)

Arguments

res

Structure that is the output of the function PCA

var_ind

Character string that indicates if variables (var) or individuals (ind) will be plotted. Default: "ind"

select

Character string with a selection criterion (see details) or an integer vector with the sequence numbers of the active elements that are selected (i.e. be given a different layout than the other elements). Default: NULL (i.e. all are selected)

axes

Numeric vector with two integers indicating the dimensions that will be plotted. Default: 1:2

Details

The select mechanism is taken over asis from the PCA function. The labels of selected elements will be plotted.
The authors Francois Husson husson@agrocampus-ouest.fr and Jeremy Mazet describe it as follows:

The select argument can be used in order to select a part of the elements (individuals if you draw the graph of individuals, or variables if you draw the graph of variables) that are drawn. For example, you can use:
select = 1:5 and then the elements 1:5 are drawn.
select = c("name1","name5") and then the elements that have the names name1 and name5 are drawn.
select = "coord 10" and then the 10 elements that have the highest (squared) coordinates on the 2 chosen dimensions are drawn.
select = "contrib 10" and then the 10 elements that have the highest contribution on the 2 dimensions of your plot are drawn.
select = "cos2 5" and then the 5 elements that have the highest cos2 on the 2 dimensions of your plot are drawn.
select = "dist 8" and then the 8 elements that have the highest distance to the center of gravity are drawn.

NB. the following functionality is contained in plot.PCA but not described there:
select = "cos2 0.8" and then the elements for which the sum of the cos2 on the 2 dimensions of your plot is greater than 0.8 are drawn.

Acknowledgements

All ideas come from the creators of the FactoMineR package. This implementation is mine and if you find any errors, these will be mine.

Examples

## Not run: 
plot_PCA_select(res,var_ind = 'ind',sel='contrib 6', axes = 1:2)

## End(Not run)

HanOostdijk/HOQCutil documentation built on July 28, 2023, 5:56 p.m.