Mod 7 R
Daniel Tafmizi
Dr. Friedman
October 15, 2024
Lis 4317
Module 7
Github: daniel.R/Work.R/LIS4370Rprog/dataviz2.R at main · DanielDataGit/daniel.R (github.com)
I used two methods to analyze the distribution of the mtcars dataset.
First, I created a scaled heatmap to visualize how various attributes change across each car, ordered by mpg. Although this method doesn't provide a direct statistical analysis of the data's distribution, it offers valuable insights into how the attributes are spread out across different vehicles.
Second, I utilized a function called ggpairs, which was new to me and proved to be a powerful tool for distribution analysis. This function generates three types of visualizations: density plots, scatterplots, and correlation coefficients. These visualizations observe the distribution of data both within individual attributes and across multiple attributes, while also highlighting how these variables are correlated. My next goal with this function is to learn how to turn variables into factors. I could not see a way to do this in the ggpair arg's, thus it probably needs to be done before calling the dataframe into it.


Comments
Post a Comment