Session Ready
Exercise

PCA with FactoMineR

As you saw in the video, FactoMineR is a very useful package, rich in functionality, that implements a number of dimensionality reduction methods. Its function for doing PCA is PCA() - easy to remember! Recall that PCA(), by default, generates 2 graphs and extracts the first 5 PCs. You can use the ncp argument to manually set the number of dimensions to keep.

You can also use the summary() function to get a quick overview of the indices of the first three principal components. Moreover, for extracting summaries of some of the rows in a dataset, you can specify the nbelements argument. You'll have a chance to practice all of these and more in this exercise!

As in the previous lesson, the cars dataset is available in your workspace.

Instructions 1/4
undefined XP
  • 1
  • 2
  • 3
  • 4

Run PCA() on the 10 numeric variables (9 to 19) of cars and extract 4 dimensions. To set the number of dimensions, you need to use the ncp argument of PCA(). The graph argument is set to F to suppress the default graphical output PCA().