Skip to content

row_number() fails in the some corner cases #3454

@vpanfilov

Description

@vpanfilov

row_number() windowed function fails in the corner case with 0x0 tibble:

library(tidyverse)

tibble() %>% mutate(a = row_number())
#> Error in mutate_impl(.data, dots) :
#>   Evaluation error: argument "x" is missing, with no default.

UPD: Found another misleading behaviour:

library(tidyverse)

tibble(a = 1) %>%
  mutate(b = row_number())
#> # A tibble: 1 x 2
#>       a     b
#>   <dbl> <int>
#> 1    1.     1

tibble(a = 1) %>%
  mutate(b = dplyr::row_number())
#> Error in mutate_impl(.data, dots) : 
#>   Evaluation error: argument "x" is missing, with no default.

Metadata

Metadata

Labels

bugan unexpected problem or unintended behavior

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions