Skip to content

Allow rows_update() to update duplicate keys in x #5553

@DavisVaughan

Description

@DavisVaughan

In this case, I expect that the 2 and 3 in df1$y would both be updated to 4.

I would expect that, in rows_update(), the y data frame should have unique keys, but the x data frame should not have that restriction.

library(dplyr)
​
df1 <- tibble(x = c(1, 1, 2), y = c(2, 3, 5))
df2 <- tibble(x = 1, y = 4)
​
# `x` must have unique keys??
rows_update(df1, df2, by = "x")
#> Error: `x` key values are not unique.

Possibly consider how this affects other rows_*() functions

Metadata

Metadata

Assignees

No one assigned

    Labels

    featurea feature request or enhancementtables 🧮joins and set operations

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions