Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Very rare issue in quantcut #22

Open
simon-lowe opened this issue Jun 9, 2024 · 1 comment
Open

Very rare issue in quantcut #22

simon-lowe opened this issue Jun 9, 2024 · 1 comment

Comments

@simon-lowe
Copy link

In quantcut I am very rarely getting the following error message:

Error in if (pairs[1, i] == pairs[1, i - 1] && pairs[1, i] == pairs[2, :
missing value where TRUE/FALSE needed

Because it is happening inside a function running over random draws I don't have a reproducible example. The quantcut call is the following:
quantcut(pred_p, q = n_groups, labels = FALSE)

Looking at the source code, I can't actually figure what the issue is. Any ideas?

Thanks!

@bbolker
Copy link
Contributor

bbolker commented Jun 29, 2024

I often derive reproducible examples from random examples by doing something like this:

last <- 0
for (i in 1:10000) {
   last <- i
   set.seed(i)
   [try the desired code]
}

The code will stop when the error happens and you should then be able to set.seed(last) and reproduce it ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants