if (FALSE) {
data(iris)
S <- surScat(iris, variables=names(iris)[1:4], type="pca", nclusters=3)
P <- prcomp(iris[,1:4], scale.=TRUE)$x
S <- addAxes(S, P[,3:4])
S <- addAxes(S, as.matrix(iris[,1:2]), name="sepal")
# every plane turned onto PCA, the one drawn first
A <- layoutsAlign(S)
A
attr(A, "alignment")$angle
# onto another plane, by its name
A <- layoutsAlign(S, to="sepal")
# the original planes kept, the aligned ones added as "PC3-PC4'" and "sepal'"
A <- layoutsAlign(S, suffix="'")
names(A$layouts)
# towards the mean of them all
G <- layoutsAlign(S, gpa=TRUE)
head(attr(G, "alignment")$consensus)
# the coordinates alone, from a list of planes
L <- layoutsAlign(S$layouts, which=c("sepal", "PC3-PC4"), to=1)
}
Run the code above in your browser using DataLab