Skip to content

Conversation

@MichaelChirico
Copy link
Contributor

As identified by lintr::vector_logic_linter().

&& and || are appropriate inside if() / while() conditions, where passing a vector is incorrect (maybe an error, depending on the R version, and if not, has possibly misleading behavior).

&&/|| also have early exit where &/| do not, c.f. TRUE || stop('hi') vs. TRUE | stop('hi').

@edzer edzer merged commit 76462fd into r-spatial:main Jun 22, 2023
@MichaelChirico MichaelChirico deleted the vector-logic branch June 22, 2023 18:02
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.

2 participants