graphVar: Variables factor map

Description Usage Arguments Details Author(s) See Also Examples

View source: R/graphVar.R

Description

Realise the optimised variables graph

Usage

1
2
graphVar(res, file = "", dim = 1:2, Vselec = "cos2", Vcoef = 1, 
         figure.title = "Figure", graph = TRUE, cex = 0.7, options=NULL)

Arguments

res

an object of class PCA or MCA.

file

the file path where to write the description in Rmarkdown language. If not specified, the description is written in the console.

dim

a 2 dimensional numerical vector giving the factorial dimensions to use for the representation (by default the first plane).

Vselec

the variables to select ; see the details section.

Vcoef

a numerical coefficient to adjust the variables selection rule ; see the details section.

figure.title

the text label to add before graph title.

graph

a boolean : if TRUE, graphs are plotted.

cex

an optional argument for the generic plot functions, used to adjust the size of the elements plotted.

options

a character string that gives the output options fir the figures. If NULL, options="r, echo = FALSE, fig.align = 'center', fig.height = 3.5, fig.width = 5.5" for linux and Mac and options="r, echo = FALSE, fig.height = 3.5, fig.width = 5.5" for Windows

Details

The Vselec argument is used in order to select a part of the variables that are drawn and described. For example, you can use either :
- Vselec = 1:5 then the variables numbered 1 to 5 are drawn.
- Vselec = c("name1","name5") then the variables named name1 and name5 are drawn.
- Vselec = "contrib 10" then the 10 active or illustrative variables that have the highest contribution on the 2 dimensions of the plane are drawn.
- Vselec = "contrib" then the optimal number of active or illustrative variables that have the highest contribution on the 2 dimensions of the plane are drawn.
- Vselec = "cos2 5" then the 5 active or illustrative variables that have the highest cos2 on the 2 dimensions of the plane are drawn.
- Vselec = "cos2 0.8" then the active or illustrative variables that have a cos2 higher to 0.8 on the plane are drawn.
- Vselec = "cos2" then the optimal number of active or illustrative variables that have the highest cos2 on the 2 dimensions of the plane are drawn.

The Vcoef argument is used in order to adjust the selection of the variables when based on Vselec = "contrib" or Vselec = "cos2". For example :
- if Vcoef = 2, the threshold is 2 times higher, and thus 2 times more restrictive.
- if Vcoef = 0.5, the threshold is 2 times lower, and thus 2 times less restrictive.

Author(s)

Simon Thuleau and Francois Husson

See Also

factoGraph, graphInd, graphHab, graphCA, graphSup

Examples

1
2
3
4
require(FactoMineR)
data(decathlon)
res.pca = PCA(decathlon, quanti.sup = c(11:12), quali.sup = c(13), graph = FALSE)
graphVar(res.pca)

Example output

Loading required package: FactoMineR

```{r, echo = FALSE, fig.align = 'center', fig.height = 3.5, fig.width = 5.5}
drawn <-
c("Points", "400m", "Shot.put", "Discus", "Long.jump", "100m", 
"110m.hurdle")
par(mar = c(4.1, 4.1, 1.1, 2.1))
plot.PCA(res, select = drawn, axes = 1:2, choix = 'var', title = '', cex = cex)
```

**Figure - Variables factor map (PCA)**
*The variables in black are considered as active whereas those in blue are illustrative.*
*The labeled variables are those the best shown on the plane.*

FactoInvestigate documentation built on May 5, 2018, 5:04 p.m.