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.
- 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")
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.
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.
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?