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

add error message checking the integer sample size #328

Merged

Conversation

LittleBeannie
Copy link
Collaborator

@LittleBeannie LittleBeannie commented Jan 31, 2024

Fixes #322

@LittleBeannie LittleBeannie self-assigned this Jan 31, 2024
@LittleBeannie LittleBeannie linked an issue Jan 31, 2024 that may be closed by this pull request
@nanxstats
Copy link
Collaborator

Nice... Maybe is.wholenumber() in gsDesign is a useful one-liner internal function to copy here for repeated use:

https://github.com/keaven/gsDesign/blob/bd70f66e346603229b46de2a7a84f0a714857ba1/R/toInteger.R#L159

@LittleBeannie
Copy link
Collaborator Author

Nice... Maybe is.wholenumber() in gsDesign is a useful one-liner internal function to copy here for repeated use:

https://github.com/keaven/gsDesign/blob/bd70f66e346603229b46de2a7a84f0a714857ba1/R/toInteger.R#L159

Thanks for the suggestion. Yeah, gsDesign2 exactly apply the same logic as in gsDesign:::is.wholenumber. Since it is a short function, and we only use it once, shall we just use it within the if condition?

Copy link
Collaborator

@nanxstats nanxstats left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ported and added it as is_wholenumber() to encourage code reuse.

@nanxstats nanxstats merged commit eb1d509 into main Feb 1, 2024
8 checks passed
@nanxstats nanxstats deleted the 322-add-assertions-before-feeding-inputs-into-npsurvss branch February 1, 2024 07:19
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.

Add assertions before feeding inputs into npsurvSS
2 participants