Skip to content

Hoist removes duplicated names from list - even if they are not targeted at all #1259

Description

@LukasWallrich

I am aware that hoist does not like duplicated names in lists. However, I now came across a behaviour (2 below) that led to a lot of debugging effort and should - in my view - either be changed or at least trigger a warning.

  1. Requesting a duplicated name

This extracts "name" and silently deletes "idea" - I didn't expect that, but it is maybe the expected behaviour. However, I would suggest to at least document this explicitly.

tibble(x = list(list("my" = "name", "my" = "idea", "your" = "victory"))) %>% hoist(x, "my")

2) Requesting another name with hoist - the real issue

This extracts "victory" and silently drops "idea" - in my understanding, all list elements but ["your"] should be left alone ... anything else should at least trigger a warning?

tibble(x = list(list("my" = "name", "my" = "idea", "your" = "victory"))) %>% hoist(x, "your")

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions