R: Filtering data frames by column type (‘x’ must be numeric)

See the original posting on DZone Python

I’ve been working through the exercises from An Introduction to Statistical Learning and one of them required you to create a pair wise correlation matrix of variables in a data frame.

The exercise uses the ‘Carseats’ data set which can be imported like so:
Preview Text: 

I’ve been working through the exercises from An Introduction to…