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

eliminate = NULL in gnm #14

Closed
goranbrostrom opened this issue Oct 1, 2019 · 1 comment
Closed

eliminate = NULL in gnm #14

goranbrostrom opened this issue Oct 1, 2019 · 1 comment

Comments

@goranbrostrom
Copy link

Calling gnm with 'eliminate = NULL' leads to failure despite the fact that NULL is the default value of eliminate. The reason is the code snippet

if (!missing(eliminate)) {
eliminate <- modelData$(eliminate)
if (!is.factor(eliminate))
stop("'eliminate' must be a factor")

Wouldn't it be better to replace the first line with 'if (!is.null(eliminate))'?

hturner added a commit that referenced this issue Oct 1, 2019
@hturner
Copy link
Owner

hturner commented Oct 1, 2019

Thanks for the report. The fix was slightly more complicated as eliminate is usually specified symbolically and then evaluated as if it were a term in the formula. However, I've just committed an update to the master branch that should work with eliminate = NULL.

@hturner hturner closed this as completed Oct 1, 2019
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