Using the robust=FALSE flag results in an error "number of items to replace is not a multiple of replacement length" because PCA a scores matrix with greater than 2 components which princomp will do, but won't occur because of k=2 in the call to pcaPP::PCAproj
Suggested fix: just take the first two columns of scores.
I'd not that I get surprisingly different results between robust and non-robust PCA with hdr on a quick test I did and visually the robust results make more sense. Also your paper seems to suggest better performance when not using robust PCA but the default in the R code is robust=TRUE.
Using the
robust=FALSE
flag results in an error "number of items to replace is not a multiple of replacement length" because PCA a scores matrix with greater than 2 components whichprincomp
will do, but won't occur because ofk=2
in the call topcaPP::PCAproj
Suggested fix: just take the first two columns of scores.
I'd not that I get surprisingly different results between robust and non-robust PCA with hdr on a quick test I did and visually the robust results make more sense. Also your paper seems to suggest better performance when not using robust PCA but the default in the R code is
robust=TRUE
.