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

Fix some problematic class comparisons #389

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MichaelChirico
Copy link

class() is not guaranteed to return an object of length 1, so statements like if (class(x) == "y") are problematic since this is often a vector comparison inside a scalar logical operator (if).

I fixed a few of these for illustration, but many more remain in the package. You can see them with lintr::lint_package(linters = lintr::class_equals_linter()).

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.

1 participant