Module 8 - Correlation Analysis and ggplot2

 For this assignment, the class was tasked with creating a correlation analysis diagram. I chose to create a heatmap of the mtcars data set. The diagram demonstrates the correlation between each variable in the dataset. Items in light blue are highly correlated, whereas the darker colors are less closely correlated. 


Below is the code I used to create my heatmap:

qplot(x=Var1, y=Var2, data=melt(cor(mtcars)), fill=value, geom="tile")

I went through several iterations of the qplot function before realizing that the code had been provided. At first, I was confused as to how qplot worked and tried to use only two variables that I named, before consulting with ChatGPT to develop a working solution. I discovered that heatmaps represent a correlation analysis between groups of variables that are identified as var1 and var2, x and y respectively. 

This assigment helped me to understand how heatmaps can represent correlation analysis of variables within larger datasets.

Comments

Popular posts from this blog

Module 2 - Geographic Visualizations in Tableau

Final Project

Module 7 - Distribution Analysis