Finds principal components of a weitrix. If varimax rotation is enabled, these are then rotated to enhance interpretability.

weitrix_components(
weitrix,
p = 0,
design = ~1,
n_restarts = 3,
max_iter = 1000,
tol = 1e-05,
use_varimax = TRUE,
initial = NULL,
verbose = TRUE
)

weitrix_components_seq(
weitrix,
p,
design = ~1,
n_restarts = 3,
max_iter = 1000,
tol = 1e-05,
use_varimax = TRUE,
verbose = TRUE
)

## Arguments

weitrix A weitrix object, or an object that can be converted to a weitrix with as_weitrix. Number of components to find. A formula referring to colData(weitrix) or a matrix, giving predictors of a linear model for the experimental design. By default only an intercept term is used, i.e. rows are centered before finding components. A more complex formula might be used to account for batch effects. ~0 can be used if rows are already centered. Number of restarts of the iteration to use. Maximum iterations. Stop iterating if R-squared increased by less than this amount in an iteration. Use varimax rotation to enhance interpretability of components. Optional, an initial guess for column components (scores). Can have fewer columns than p, in which remaining components are initialized randomly. Can have more columns than p, in which case a randomly chosen subspace is used in each restart. Show messages about the progress of the iterations.