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

lint error: logical operator to use && instead of & #611

Closed
donyunardi opened this issue Sep 20, 2022 · 5 comments
Closed

lint error: logical operator to use && instead of & #611

donyunardi opened this issue Sep 20, 2022 · 5 comments

Comments

@donyunardi
Copy link
Contributor

I'm not sure what to do about the commented code. Both lines look okay to me. And for scalar logical operator, isn't in R we can do logical operator using & and &&? Are we enforcing the usage of &&?

No. For bit operations and vector operation we could use &, but for logical operation we should use &&

Originally posted by @arkadiuszbeer in #602 (comment)

@donyunardi
Copy link
Contributor Author

We have couple places to update in the package:

image

However, I saw this sentence when I read the logical operator documentation (?Logic):

Using vectors of more than one element in && or || will give a warning (as from R 4.2.0), or an error if the environment variable _R_CHECK_LENGTH_1_LOGIC2_ is set to a true value (this is intended to become the default in future).

@arkadiuszbeer is it still okay to move forward with the update as lint suggested?

@shajoezhu
Copy link
Contributor

I think this issue will require some careful investigation

@arkadiuszbeer
Copy link
Contributor

Hi @donyunardi,
What is the current status of this issue?
Have you applied the lint suggestions?
Could we close this issue?

@donyunardi
Copy link
Contributor Author

Hi @arkadiuszbeer
I checked on this and the team did make the changes as suggested.
@shajoezhu if you don't see anything failing, I think we can close this issue.

@shajoezhu
Copy link
Contributor

Sounds good! Thanks @donyunardi and @arkadiuszbeer

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

No branches or pull requests

3 participants