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

row_number(df) has an unexpected behavior for zero col data frames #6899

Closed
moodymudskipper opened this issue Aug 2, 2023 · 1 comment
Closed

Comments

@moodymudskipper
Copy link

The results is actually non stable

# zero col
row_number(data.frame(row.names = 1:10))
#> [1] 582098136         1 582098024         1 585748024         1 537055392         1 251706160         1

# one col
row_number(data.frame(10:1))
#> [1] 10  9  8  7  6  5  4  3  2  1

My expectation would have been 1:10 (we have nothing to order so all rows are assumed equal and disambiguated by using the first), but I would understand an error, or rep(NA, 10) as well.

btw the argument-less use is not documented, it was reported in #5820 but no action was taken AFAICT

@DavisVaughan
Copy link
Member

Tracking in r-lib/vctrs#1863

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants