Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to draw R language ggplot2 to show the correlation coefficient between multivariate pairwise

Shulou Source: shulou.com Published: 2022-06-01 21:59:20 10月05日 Update

This article shows you how to draw R language ggplot2 to show the correlation coefficient between multiple variables, the content is concise and easy to understand, it can definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.

Introduce the implementation method of the following figure

Image.png

The data set used is the data set of wheat seeds. Seven indexes of three varieties of wheat seeds were measured in the laboratory to explore whether the varieties of wheat seeds can be distinguished according to these indexes.

An area B perimeter C compactness LK length WK width A_coef skewness coefficient LKG groin length

Image.png

The last variable, target, is the kind of wheat to which it belongs, which is 0prime1 and 2 respectively.

The dataset is downloaded from the kaggle website. You can download the dataset yourself or leave a message at the end of the article.

The ggpairs () function in the GGally package is used to implement the diagram mentioned at the beginning of the article, and the corresponding help document is https://ggobi.github.io/ggally/reference/ggpairs.html

The first is to read in the data seed

Tags: Data variables coefficients wheat indicators seeds between language content varieties skills articles knowledge length concise compact concise below figure theme function Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL MariaDB Shulou Tech Info Redmi OPPO Reno