Skip to content

Instantly share code, notes, and snippets.

@srishtis
Created October 4, 2018 08:50
Show Gist options
  • Save srishtis/81018d5d99df4e33c3604739a5e63f37 to your computer and use it in GitHub Desktop.
Save srishtis/81018d5d99df4e33c3604739a5e63f37 to your computer and use it in GitHub Desktop.
Performing PCA with covariance matrix
# Setting the scale=FALSE option will use the covariance matrix to get the PCs
cars.PC.cov = prcomp(mtcars[,-11], scale=FALSE) # sellecting the 11 columns by indexing mtcars
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment