In line 341 of PCAtest.R, it states "find out which PCs are significant", but the code from lines 343 to 348 counts the number of significant PCs rather than identifying which specific PCs are significant. In my opinion, the code might be written as follows:
sigaxes <- c()
for (i in 1:length(eigenprob)) {
if (eigenprob[i] < alpha) {
sigaxes <- c(sigaxes, i)
}
}