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
user bvb_lc on the community forum highlighted an issue they encountered, a minimal reprex of it as follows
sum(pillar::num(c(1,NA)),na.rm=TRUE)
unfortunately the above results in
<pillar_num[1]> [1] NA
rather than the desired
<pillar_num[1]> [1] 1
link to source : https://forum.posit.co/t/na-rm-true-seems-to-not-work-for-a-tibble-with-the-datatype-of-pillar-num/187988
The text was updated successfully, but these errors were encountered:
Thanks, very interesting:
sum(vctrs::new_vctr(c(1, NA), class = c("pillar_num", "pillar_vctr")), na.rm = TRUE) #> <pillar_num[1]> #> [1] 1
requireNamespace("pillar", quietly = TRUE) sum(vctrs::new_vctr(c(1, NA), class = c("pillar_num", "pillar_vctr")), na.rm = TRUE) #> <NULL[1]> #> [1] NA
Created on 2024-06-13 with reprex v2.1.0
Looks like we need to pass along the ellipsis to vec_arith_base() :
vec_arith_base()
pillar:::vec_arith.pillar_num.default #> function (op, x, y, ...) #> { #> "!!!!DEBUG vec_arith.pillar_num.default(`v(op)`)" #> out <- vec_arith_base(op, vec_proxy(x), vec_proxy(y)) #> if (inherits(x, "pillar_num")) { #> vec_restore(out, x) #> } #> else { #> vec_restore(out, y) #> } #> } #> <bytecode: 0x11f0c9ba0> #> <environment: namespace:pillar>
Happy to review a PR.
Sorry, something went wrong.
num()
Successfully merging a pull request may close this issue.
user bvb_lc on the community forum highlighted an issue they encountered, a minimal reprex of it as follows
unfortunately the above results in
rather than the desired
link to source : https://forum.posit.co/t/na-rm-true-seems-to-not-work-for-a-tibble-with-the-datatype-of-pillar-num/187988
The text was updated successfully, but these errors were encountered: