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

nth() should take negative values to count backwards #1584

Closed
hadley opened this issue Dec 14, 2015 · 1 comment
Closed

nth() should take negative values to count backwards #1584

hadley opened this issue Dec 14, 2015 · 1 comment
Assignees
Labels
feature a feature request or enhancement
Milestone

Comments

@hadley
Copy link
Member

hadley commented Dec 14, 2015

nth(1:10, -1)
nth(1:10, -4)
@hadley hadley added the feature a feature request or enhancement label Mar 1, 2016
@hadley hadley added this to the 0.5 milestone Mar 1, 2016
hadley added a commit that referenced this issue Mar 7, 2016
@hadley
Copy link
Member Author

hadley commented Mar 7, 2016

@romainfrancois can you please also implement this for the hybrid handler?

With this change, it should be possible to have both first and last be special cases of nth. I think that should simplify the code quite a bit. Also, is it possible to pull the related code out of dplyr.cpp and put it in nth.cpp? I think that would make it easier for me to see what's going on (and easier to verify that we've covered all the corner cases)

@lock lock bot locked as resolved and limited conversation to collaborators Jun 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature a feature request or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants