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

containElements returns TRUE for invalid elements #66

Closed

Conversation

sgibb
Copy link
Member

@sgibb sgibb commented Aug 8, 2023

This PR fixes #63.

containsElements now returns NA for NA, and FALSE for invalid elements (like "Z").

I am not sure about the return value for invalid elements. IMHO NA would be fine (in that case this PR is superfluous).

If this PR is needed, we could argue about the use of suppressWarnings inside containsElements. containsElements("H2O", "Z") will return FALSE and produce a warning about "Z". (If we ignore this PR the result would be NA anyway).

@sgibb sgibb self-assigned this Aug 8, 2023
@jorainer
Copy link
Member

jorainer commented Aug 9, 2023

Hm, I don't see any added value by returning FALSE if wrong formulas/elements are provided. To me returning NA would make most sense - so I assume we close this PR?

Copy link
Member

@jorainer jorainer left a comment

Choose a reason for hiding this comment

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

As stated in the previous comment - I would return NA for if invalid formulas are provided in containsElements, so I guess this PR can be closed?

@sgibb
Copy link
Member Author

sgibb commented Aug 9, 2023

I agree, closed in favour of the behaviour introduced in #65 .

@sgibb sgibb closed this Aug 9, 2023
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.

containsElements("H2O", "Z") returns TRUE
2 participants