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

Fix a bug when attempting to use multiple constraints #27

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

RussianImperialScott
Copy link

This PR fixes a bug during the step where the gnm() function determines which coefficients to constrain based on the arguments to the function call. The original code askes if(res == 0 && length(constrain) == 1), which seems to be testing for the situation where constrain is a character vector of length 1 but does not match any of the existing coefficient names. However, when two or more coefficients to constrain are specified, then the result of res == 0 has a length greater than 1, and this causes either a warning or error (depending on the version of R, it seems?) when matched with the scalar "AND" operator &&. By using identical(res, 0) instead, we get around this issue.

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

Successfully merging this pull request may close these issues.

1 participant