Description Usage Arguments Details See Also Examples
Takes the average of several PCA objects
1 |
... |
prcomp, princomp or factanal objects, or a single list of such objects |
I don't know if this kind of calculation has any sort of merit. It was written more as an impromptu challenge than as a solution to any problem
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | xx <- data.frame(bee=c(0, 0, 1, 2, 3, 2, 0, 3),
wasp=c(1, 3, 2, 0, 1, 1, 2, 1),
fly=c(1, 2, 4, 2, 1, 0, 1, 0),
beetle=c(1, 0, 0, 1, 2, 2, 0, 2))
set.seed(1)
r <- 1000
xxs <- replicate(r, {
xx$random <- sample(c(0:1, 0:4), 8, r=TRUE)
xx
}, simplify=FALSE)
xxm <- Reduce("+", xxs) / r
xxl <- lapply(xxs, princomp)
biplot(pcamean(xxl))
biplot(princomp(xxm))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.