1. Learn
  2. /
  3. Courses
  4. /
  5. Helsinki Open Data Science

Connected

Exercise

Exploring the countries

Now that we have sufficiently wrangled the 'human' data for further analysis, let's explore the variables and their relationships more closely.

A simple pairs plot or a more informative generalized pairs plot from the GGally package is a good way of visualizing a reasonably sized data frame.

To study linear connections, correlations also can be computed with the cor() function and then visualized with the corrplot function from the corrplot package.

Instructions

100 XP
  • Create the data frame human_ by removing the Country variable from human (the countries are still the row names)
  • Access the GGally package and visualize all the human_ variables with ggpairs().
  • Compute and print out the correlation matrix of human_
  • Adjust the code: use the pipe operator (%>%) and visualize the correlation matrix with corrplot().