-
Notifications
You must be signed in to change notification settings - Fork 27
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 is.vector() #318
Comments
Is there a problem with the original code or why do you suggest to change this? |
I have not observed an issue with the original code. I just wanted to highlight that And while looking at the code, I thought that it could be re-written with a final else. But it doesn't have to be changed; I don't think there's a but - at least in the anticipated use-cases :-) I thought that additional pairs of (critical and expert) eyes should look at it. |
I'm OK with the original code - it looks clean/clear and easy to understand. But I'm also OK with changing it is you think it is necessary? Generally I would prefer |
This line uses
is.vector()
to check if a variable is an atomic vector, not only a vector (including a list):The solution here is the also specify a mode:
I would suggest to use
!is.vector(list(), "list")
!is.list()
in such cases.
For that specific code chunk, there's no final else. We could probably test for
is.list(.)
inherits(., "List")
@jorainer @sgibb - what do you think?
The text was updated successfully, but these errors were encountered: