Skip to content

Commit

Permalink
choose(n, k) it is!
Browse files Browse the repository at this point in the history
  • Loading branch information
jhelvy committed May 9, 2023
1 parent 463fc54 commit 3406823
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion R/input_checks.R
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ check_inputs_design <- function(
# https://github.com/jhelvy/cbcTools/issues/10#issuecomment-1535454495
n <- nrow(profiles)
k <- n_alts
ncomb <- factorial(n) / (factorial(k)*(factorial(n-k)))
ncomb <- choose(n, k) # More robust
# ncomb <- factorial(n) / (factorial(k)*(factorial(n-k)))
if (n_q > ncomb) {
stop(
"The number of questions per respondent, specified by n_q, ",
Expand Down

0 comments on commit 3406823

Please sign in to comment.