View source: R/SRPCAMS_helpers.R
| align | R Documentation |
Aligns loadings per neighborhood for better visualization and comparison. Different options are available.
align(PC, type = "largest", vec = NULL)
PC |
Array of loadings of size p x k x N as returned by | |||||||||||||
type |
Character string specifying the sign adjustment method. One of:
| |||||||||||||
vec |
|
Returns an array of loadings of size p times k times N.
set.seed(1)
# Note, that in this example the vectors are not feasible loadings.
COVS = list("a"= matrix(runif(16, -1, 1), 4), "b" = matrix(runif(16, -1, 1), 4))
COVS = lapply(COVS, function(x) x %*% t(x))
pca = msPCA(eta = 1, gamma = 0.5, COVS = COVS, k = 2)
x = pca$PC
align(PC = x, type = "largest")
align(PC = x, type = "maxvar")
align(PC = x, type = "mean")
align(PC = x, type = "nonzero")
align(PC = x, type = "scalar", vec = c(1,1,1,1))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.