We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi, the test for scalar evaluates also complex data types to true. For example
assertthat::is.scalar(list("foo")) [1] TRUE
This was quite unexpected to me, because it is also documented together with the test for atomic data types.
Is there a rationale not to test for the given value to be atomic? Otherwise I would propose to test:
assertthat::is.scalar <- function (x) { is.atomic(x) && length(x) == 1L }
Thanks for your help, Manuel
The text was updated successfully, but these errors were encountered:
Also
assertthat::is.scalar(data.frame(x = 1:10)) [1] TRUE
is unexpected
Sorry, something went wrong.
No branches or pull requests
Hi,
the test for scalar evaluates also complex data types to true. For example
This was quite unexpected to me, because it is also documented together with the test for atomic data types.
Is there a rationale not to test for the given value to be atomic? Otherwise I would propose to test:
Thanks for your help,
Manuel
The text was updated successfully, but these errors were encountered: