Skip to content

Commit

Permalink
Merge branch 'main' into pca_with_n1
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke authored Sep 16, 2023
2 parents 0e1b16d + 700067b commit ab63088
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions R/principal_components.R
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,14 @@ principal_components.data.frame <- function(x,
} else if (n < 1) {
n <- 1
}

## TODO: the next if-statement was removed by Dom, but this breaks
## performance code. Need to check, so we for now add this back

# sanity check - we need at least two factors
if (n < 2 && ncol(x) >= 2) {
n <- 2
}
n
}

Expand Down

0 comments on commit ab63088

Please sign in to comment.