Skip to content

Add a na.rm argument to first()/last() #4239

Description

@nbenn

Personally, I'd find it useful if gfirst()/glast() would accept a na.rm argument. This would then return the first/last non missing element of a vector (within each group).

For consistency I guess also first()/last() should then accept a na.rm argument. Although I'm not sure what this would mean if a non-atomic object (i.e. a data.frame) was passed. Maybe the flag should only be honored if is.atomic(x) && nargs() == 1L?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions