Skip to content

Instantly share code, notes, and snippets.

@lgatto
Last active December 8, 2017 16:53
Show Gist options
  • Save lgatto/94983a45c63f76d762803c460a98e334 to your computer and use it in GitHub Desktop.
Save lgatto/94983a45c63f76d762803c460a98e334 to your computer and use it in GitHub Desktop.
All PCs and %age vars
pca <- prcomp(exprs(object), scale = TRUE, center = TRUE)
pcadata <- pca$x
vars <- (pca$sdev)^2
vars <- vars / sum(vars) * 100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment