View source: R/ggcloud_variables.R

ggcloud_variables | R Documentation |

Plots a Multiple Correspondence Analysis cloud of variables.

```
ggcloud_variables(resmca, axes = c(1,2), points = "all",
min.ctr = NULL, max.pval = 0.01, face = "pp",
shapes = TRUE, prop = NULL, textsize = 3, shapesize = 3,
col = NULL, col.by.group = TRUE, alpha = 1,
segment.alpha = 0.5, vlab = TRUE, sep = ".", legend = "right")
```

`resmca` |
object of class |

`axes` |
numeric vector of length 2, specifying the components (axes) to plot. Default is c(1,2). |

`points` |
character string. If 'all' all categories are plotted (default); if 'besth' only those who contribute most to horizontal axis are plotted; if 'bestv' only those who contribute most to vertical axis are plotted; if 'besthv' only those who contribute most to horizontal or vertical axis are plotted; if 'best' only those who contribute most to the plane are plotted. |

`min.ctr` |
Numerical value between 0 and 100. The minimum contribution (in percent) for a category to be displayed if the |

`max.pval` |
Numerical value between 0 and 100. The maximal p-value derived from test-values for a category to be displayed if the |

`face` |
character string. Changes the face of the category labels when their contribution is greater than |

`shapes` |
Logical. Should shapes be plotted for categories (in addition to labels) ? Default is TRUE. |

`prop` |
If NULL, the size of the labels (if shapes=FALSE) or the shapes (if shapes=TRUE) is constant. If 'n', the size is proportional the the weights of categories; if 'ctr1', the size is proportional to the contributions of the categories on the first dimension of the plot; if 'ctr2', the size is proportional to the contributions of the categories on the second dimension of the plot; if 'ctr12', the size is proportional to the contributions of the categories on the plane ; if 'ctr.cloud', the size is proportional to the total contributions of the categories on the whole cloud; if 'cos1', the size is proportional to the quality of representation (squared cosines) of the categories on the first dimension of the plot; if 'cos2', the size is proportional to the quality of representation of the categories on the second dimension of the plot; if 'cos12', the size is proportional to the quality of representation of the categories on the plane; if 'vtest1', the size is proportional to the test-values of the categories on the first dimension of the plot; if 'vtest2', the size is proportional to the test-values of the categories on the second dimension of the plot. |

`textsize` |
Size of the labels of categories if shapes=TRUE, or if shapes=FALSE and prop=NULL. Default is 3. |

`shapesize` |
Size if the shapes of categories if shapes=TRUE and prop=FALSE. Default is 3. |

`col` |
Character string. Color name for the shapes and labels of the categories. If NULL (default), the default |

`col.by.group` |
Logical. If |

`alpha` |
Transparency of the shapes and labels of categories. Default is 1. |

`segment.alpha` |
Transparency of the line segment beside labels of categories. Default is 0.5. |

`vlab` |
Logical. Should the variable names be used as a prefix for the labels of the categories. Default is TRUE. |

`sep` |
Character string used as a separator if vlab=TRUE. |

`legend` |
the position of legends ("none", "left", "right", "bottom", "top", or two-element numeric vector). Default is right. |

a `ggplot2`

object

If `col`

argument is NULL, shapes or labels are colored according to the variables, using the default `ggplot2`

palette. The palette can be customized using any `scale_color_*`

function, such as `scale_color_brewer()`

, `scale_color_grey()`

or `scale_color_manual()`

.

If `resmca`

is of type `stMCA`

or `multiMCA`

and `points`

is not equal to `"all"`

, test-values are used instead of contributions (which are not available for these MCA variants) to select the most important categories ; if `points`

is equal to `best`

, only categories with high test-values for horizontal axis or vertical axis are plotted.

Anton Perdoncin, Nicolas Robette

Le Roux B. and Rouanet H., *Multiple Correspondence Analysis*, SAGE, Series: Quantitative Applications in the Social Sciences, Volume 163, CA:Thousand Oaks (2010).

Le Roux B. and Rouanet H., *Geometric Data Analysis: From Correspondence Analysis to Stuctured Data Analysis*, Kluwer Academic Publishers, Dordrecht (June 2004).

`ggcloud_indiv`

```
# specific MCA of Music example data set
data(Music)
junk <- c("FrenchPop.NA", "Rap.NA", "Rock.NA", "Jazz.NA", "Classical.NA")
mca <- speMCA(Music[,1:5], excl = junk)
# cloud of variables
ggcloud_variables(mca)
# cloud of variables with only categories contributing the most
ggcloud_variables(mca, points = "best", prop = "n")
# cloud of variables with other plotting options
ggcloud_variables(mca, shapes = FALSE, legend = "none",
col = "black", face = "ui")
```

GDAtools documentation built on Oct. 6, 2023, 5:07 p.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.