Home > front end >  Visualizing PCA in a scatterplot matrix in R
Visualizing PCA in a scatterplot matrix in R

Time:01-09

Im new to R and cleaned the https://www.kaggle.com/camnugent/california-housing-prices dataset (removed Ocean_proximity column) and used this function on it
housing.pca <- prcomp(housing, center = TRUE,scale. = TRUE)
The summary tells me a Proportion of Variance 0.2483 0.2187 0.2014 0.1753 ...
I now want to use a scatterplot matrix to visualize the first 4 PCA Components but i cant figure out how and couldnt find any help

CodePudding user response:

Run plot(as.data.frame(housing.pca$x[,1:4])) for the first 4 principal components.

  •  Tags:  
  • Related