> For the complete documentation index, see [llms.txt](https://laboratory-of-lipid-metabolism-a.gitbook.io/omics-data-visualization-in-r-and-python/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://laboratory-of-lipid-metabolism-a.gitbook.io/omics-data-visualization-in-r-and-python/metabolites-and-lipids-descriptive-statistical-analysis-in-r/ggally-for-quick-overviews.md).

# GGally for quick overviews

In this subchapter, we want to introduce the package **GGally, a great extension of the ggplot package**. We will show one function, that can be useful if a fast glimpse at the descriptive statistics is necessary, e.g. while building models. However, with all your current skills in R, we encourage you to investigate this library and its functions more deeply. More information can be found here:

{% embed url="<http://www.sthda.com/english/wiki/ggally-r-package-extension-to-ggplot2-for-correlation-matrix-and-survival-plots-r-software-and-data-visualization>" %}
Introduction to the GGally package.
{% endembed %}

We will show you the function called **ggpairs()**. It can be applied to make a matrix of plots with your data set. Using one word, you can immediately plot for your numeric data:

* box plots,
* density plots,
* scatter plots,
* histograms,
* and the information about the correlation value.

Check this simple code below and the obtained plot:

```r
# Installing GGally:
install.packages("GGally")

# Calling library:
library(GGally)

# Consulting the documentation about the function:
?ggpairs()

# Creating an exemplary overview of selected features:
data %>%
  select(`Label`,
         `SM 39:1;O2`,
         `SM 40:1;O2`,
         `SM 41:1;O2`,
         `SM 42:1;O2`) %>%
  ggpairs()
```

The output:

<figure><img src="/files/L3HF5nGt2aggdjbU0IXw" alt=""><figcaption><p>Fast overview of selected SM species created using the GGally library.</p></figcaption></figure>
