pca_association_plot | R Documentation |
Graphical test between principal components and a table of covariates.
pca_association_plot(a, b, ...) ## S4 method for signature 'data.frame,matrix' pca_association_plot( a, b, method = c("irlba", "prcomp"), n = 20, npcs = min(ncol(a) - 1, nrow(a) - 1, 50), center = TRUE, scale = TRUE, max_iterations = 1e+05, vars_keep = NULL, vars_ignore = NULL, ... ) ## S4 method for signature 'ANY,ANY' pca_association_plot(a, b, ...) ## S4 method for signature 'data.frame,missing' pca_association_plot(a, b, ...) ## S4 method for signature 'ANY,data.frame' pca_association_plot(a, b, ...) ## S4 method for signature 'data.frame,irlba_prcomp' pca_association_plot( a, b, npcs = ncol(b$x), ncovariates = 20, vars_keep = NULL, vars_ignore = NULL, progress_bar = FALSE, ... ) ## S4 method for signature 'data.frame,prcomp' pca_association_plot( a, b, npcs = ncol(b$x), ncovariates = 20, vars_keep = NULL, vars_ignore = NULL, progress_bar = FALSE, ... )
a |
A matrix or data.frame-alike of covariates. |
b |
A matrix, or the output of |
... |
Passed to specific methods. |
method |
The method used to calculate PCs. Can be |
n |
The maximum number of variables to be shown in the PCA plot (the top n are taken based on the minimum association p-value). |
npcs |
The number of PCs to truncate the results to. For large datasets visualising >50 PCs is unwieldy so setting this to (e.g.) 20 can be very useful. |
center, scale |
Passed to PCA methods. Should the data be scaled and centered before performing PCA? |
max_iterations |
Passed to |
vars_keep, vars_ignore |
Vectors of variables to keep or remove from the plot, regardless of p-value filtering. |
progress_bar |
Show a progress bar when testing associations? Useful for very large datasets. |
The output of plot_grid, a set of plots showing variance explained
and associations between the columns of a
and the principal components
of b
.
mat <- matrix(rnorm(1000), ncol = 10) pc <- prcomp(mat) pca_association_plot(mat, pc) ## only the top 5 associations pca_association_plot(mat, pc, n = 5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.