Session Ready
Exercise

Generating correlation matrices

Finally, let's write another function that generates a correlation matrix from a data.table. To do this, you'll need to grab all the numeric columns (based on column name) and change the data.table into a matrix.

A function get_numeric_cols() has been defined for you. It returns a character vector with names of the numeric column names.

Instructions
100 XP
  • corrmat_from_dt() should return a correlation matrix of the numeric columns in the data.table you pass it.
  • Call it on diagnosticDT and diagnosticDT2 to check that it works.