Skip to content

pillar::num type vector is not properly treated by base::sum (with respect to na.rm=TRUE)  #659

Closed
@nirguk

Description

@nirguk

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions