R language ggplot2 how to draw a square heat map and show the correlation coefficient
R language ggplot2 how to draw a square heat map and show the correlation coefficient, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain in detail, people with this need can come to learn, I hope you can gain something.
The first step of the text version is to do correlation analysis to obtain the correlation coefficient.
The data format that needs to be prepared for correlation analysis in R language is as follows: each row is a sample, each column is a variable, stored in excel, and then saved as csv format data
Image.png
If you need sample data, you can leave a message at the end of the text.
The first is to read in the data df