Skip to content

Capture and update error in mutate() step of group_by() and distinct() #5060

@romainfrancois

Description

@romainfrancois

Because this is confusing:

library(tidyverse)

tibble(a = 1, b = 2) %>%
  group_by(c = a * b, d = e + 1)
#> Error: `mutate()` argument `d` errored.
#> ℹ `d` is `e + 1`.
#> x object 'e' not found
tibble(a = 1, b = 2) %>%
  distinct(c = a * b, d = e + 1)
#> Error: `mutate()` argument `d` errored.
#> ℹ `d` is `e + 1`.
#> x object 'e' not found

Follow up of: #5057

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions