---
title: "ggally_*(): List of available high-level plots"
output: 
  rmarkdown::html_vignette:
    toc: true
author: GGally Team
date: May 28, 2020
vignette: >
  %\VignetteIndexEntry{ggally_*(): List of available high-level plots}
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}
---

```{r, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
```

The purpose of this vignette is to display all high-level plots available in `GGally` to be used in particular with `ggduo()` and `ggpairs()`. The name of all the corresponding functions are of the form `ggally_*()`. Most of them accept a discrete variables to be passed to the **colour** aesthetic.

We can distinct **bivariate plots** requiring two variables for **x** and **y** axis respectively and **diagonal plots** when the same variable is plotted on **x** and **y** axis.

```{r}
library(GGally, quietly = TRUE)
data(tips, package = "reshape")
```


## Bivariate plots

### with 2x continuous variables

#### `ggally_autopoint()`

```{r}
ggally_autopoint(tips, aes(x = total_bill, y = tip))
ggally_autopoint(tips, aes(x = total_bill, y = tip, colour = time))
```

#### `ggally_cor()`

```{r}
ggally_cor(tips, aes(x = total_bill, y = tip))
ggally_cor(tips, aes(x = total_bill, y = tip, colour = time))
```

See also `ggally_statistic()`.

#### `ggally_density()`

```{r}
ggally_density(tips, aes(x = total_bill, y = tip))
ggally_density(tips, aes(x = total_bill, y = tip, colour = time))
```

#### `ggally_points()`

```{r}
ggally_points(tips, aes(x = total_bill, y = tip))
ggally_points(tips, aes(x = total_bill, y = tip, colour = time))
```


#### `ggally_smooth()`, `ggally_smooth_lm()` & `ggally_smooth_loess()`

```{r}
ggally_smooth_lm(tips, aes(x = total_bill, y = tip))
ggally_smooth_lm(tips, aes(x = total_bill, y = tip, colour = time))

ggally_smooth_loess(tips, aes(x = total_bill, y = tip))
ggally_smooth_loess(tips, aes(x = total_bill, y = tip, colour = time))
```

See also `ggally_smooth()` for more options.

### with 2x discrete variables

#### `ggally_colbar()`

```{r}
ggally_colbar(tips, aes(x = day, y = smoker))
```

Note: the **colour** aesthetic is not taken into account.

#### `ggally_autopoint()`

```{r}
ggally_autopoint(tips, aes(x = day, y = smoker))
ggally_autopoint(tips, aes(x = day, y = smoker, colour = time))
```


#### `ggally_count()`

```{r}
ggally_count(tips, aes(x = day, y = smoker))
ggally_count(tips, aes(x = day, y = smoker, colour = time))
```

#### `ggally_cross()`

```{r}
ggally_cross(tips, aes(x = day, y = smoker))
ggally_cross(tips, aes(x = day, y = smoker, colour = time))
ggally_cross(tips, aes(x = day, y = smoker, colour = smoker))
```

Note: **colour** aesthetic is taken into account only if it corresponds to **x** or to **y**.

#### `ggally_crosstable()`

```{r}
ggally_crosstable(tips, aes(x = day, y = smoker))
ggally_crosstable(tips, aes(x = day, y = smoker), cells = "col.prop", fill = "std.resid")
```

Note: **colour** aesthetic is not taken into account.

#### `ggally_facetbar()`

```{r}
ggally_facetbar(tips, aes(x = day, y = smoker))
ggally_facetbar(tips, aes(x = day, y = smoker, colour = time))
```

#### `ggally_ratio()`

```{r}
ggally_ratio(tips, aes(x = day, y = smoker))
ggally_ratio(tips, aes(x = day, y = smoker, colour = time))
```

#### `ggally_rowbar()`

```{r}
ggally_rowbar(tips, aes(x = day, y = smoker))
```

Note: the **colour** aesthetic is not taken into account.

#### `ggally_table()`

```{r}
ggally_table(tips, aes(x = day, y = smoker))
ggally_table(tips, aes(x = day, y = smoker, colour = time))
ggally_table(tips, aes(x = day, y = smoker, colour = smoker))
```

Note: **colour** aesthetic is taken into account only if it corresponds to **x** or to **y**.

#### `ggally_trends()`

```{r}
ggally_trends(tips, aes(x = day, y = smoker))
ggally_trends(tips, aes(x = day, y = smoker, colour = time))
```

### with 1x continuous and 1x discrete variables


#### `ggally_autopoint()`

```{r}
ggally_autopoint(tips, aes(x = total_bill, y = day))
ggally_autopoint(tips, aes(x = total_bill, y = day, colour = time))
```


#### `ggally_box()` & `ggally_box_no_facet()`

```{r}
ggally_box(tips, aes(x = total_bill, y = day))
ggally_box(tips, aes(x = total_bill, y = day, colour = time))
ggally_box_no_facet(tips, aes(x = total_bill, y = day))
ggally_box_no_facet(tips, aes(x = total_bill, y = day, colour = time))
```

#### `ggally_denstrip()`

```{r}
ggally_denstrip(tips, aes(x = total_bill, y = day))
ggally_denstrip(tips, aes(x = total_bill, y = day, colour = time))
```

#### `ggally_dot()` & `ggally_dot_no_facet()`

```{r}
ggally_dot(tips, aes(x = total_bill, y = day))
ggally_dot(tips, aes(x = total_bill, y = day, colour = time))
ggally_dot_no_facet(tips, aes(x = total_bill, y = day))
ggally_dot_no_facet(tips, aes(x = total_bill, y = day, colour = time))
```

#### `ggally_facetdensitystrip()`

```{r}
ggally_facetdensitystrip(tips, aes(x = total_bill, y = day))
ggally_facetdensitystrip(tips, aes(x = total_bill, y = day, colour = time))
```

#### `ggally_facethist()`

```{r}
ggally_facethist(tips, aes(x = total_bill, y = day))
ggally_facethist(tips, aes(x = total_bill, y = day, colour = time))
```

#### `ggally_summarise_by()`

```{r}
ggally_summarise_by(tips, aes(x = total_bill, y = day))
ggally_summarise_by(tips, aes(x = total_bill, y = day, colour = day))
```

Note: colour aesthetic is kept only if corresponding to the discrete axis.

#### `ggally_trends()`

```{r}
ggally_trends(tips, aes(y = total_bill, x = day))
ggally_trends(tips, aes(y = total_bill, x = day, colour = time))
```

## Diagonal plots

### with 1x continuous variable


#### `ggally_autopointDiag()`

```{r}
ggally_autopointDiag(tips, aes(x = total_bill))
ggally_autopointDiag(tips, aes(x = total_bill, colour = time))
```

#### `ggally_barDiag()`

```{r}
ggally_barDiag(tips, aes(x = total_bill))
ggally_barDiag(tips, aes(x = total_bill, colour = time))
```

#### `ggally_densityDiag()`

```{r}
ggally_densityDiag(tips, aes(x = total_bill))
ggally_densityDiag(tips, aes(x = total_bill, colour = time))
```

### with 1x discrete variable

#### `ggally_autopointDiag()`

```{r}
ggally_autopointDiag(tips, aes(x = day))
ggally_autopointDiag(tips, aes(x = day, colour = time))
```

#### `ggally_barDiag()`

```{r}
ggally_barDiag(tips, aes(x = day))
ggally_barDiag(tips, aes(x = day, colour = time))
```

#### `ggally_countDiag()`

```{r}
ggally_countDiag(tips, aes(x = day))
ggally_countDiag(tips, aes(x = day, colour = time))
```


#### `ggally_densityDiag()`

```{r}
ggally_densityDiag(tips, aes(x = day))
ggally_densityDiag(tips, aes(x = day, colour = time))
```

## Additional plots

- `ggally_statistic()` and `ggally_text()` to display custom text
- `ggally_blank()` and `ggally_blankDiag()` for blank plot
- `ggally_na()` and `ggally_naDiag()` to display a large `NA`
