Skip to content
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

first(), last(), and nth() should have na.rm argument #6242

Closed
hadley opened this issue Apr 26, 2022 · 4 comments · Fixed by #6397
Closed

first(), last(), and nth() should have na.rm argument #6242

hadley opened this issue Apr 26, 2022 · 4 comments · Fixed by #6397
Labels
feature a feature request or enhancement funs 😆

Comments

@hadley
Copy link
Member

hadley commented Apr 26, 2022

Since they're summary functions

@DavisVaughan
Copy link
Member

Do you want it to be na.rm or na_rm? first() and friends have order_by as an argument already so we'd end up with a mix of snake and dot case.

I think I have a slight preference for na_rm to avoid the mixed case, and because we generally use _. I personally prefer this over being similar to base R usage of na.rm

@hadley
Copy link
Member Author

hadley commented May 8, 2022

Hmmmm, I'm not sure. In most cases I think using snake case would be the obvious choice, but na.rm is just so ubiquitous. But you're probably right that na_rm is the better choice.

@tnederlof
Copy link

Good point on the mixing of cases, I just changed all to na_rm instead in #6257

@DavisVaughan
Copy link
Member

Randomly stumbled across a case where someone could use this https://stackoverflow.com/questions/73282239/retrieve-first-non-na-value-based-on-another-time-variable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement funs 😆
Projects
None yet
3 participants