Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for non-recursive version of list_modify #822

Closed
vspinu opened this issue Mar 20, 2021 · 1 comment · Fixed by #921
Closed

Add support for non-recursive version of list_modify #822

vspinu opened this issue Mar 20, 2021 · 1 comment · Fixed by #921
Labels
feature a feature request or enhancement list 🧦

Comments

@vspinu
Copy link
Member

vspinu commented Mar 20, 2021

Sometimes recursion is not needed when modifying lists. Would be nice to have recursive = TRUE argument to list_modify and list_merge. Or maybe a bit more control over which objects should be considered atomic. For instance, one often it's useful to treat data.frames as atomic.

> a <- list(x = data.frame(one = 1, two = 2))
> b <- list(x = data.frame(three = 3))
> list_modify(a, b)
# current
$x
  one two three
1   1   2     3
# desired
$x
  three
1     3
@hadley
Copy link
Member

hadley commented Aug 27, 2022

Agreed, I think this is what I usually want.

hadley added a commit that referenced this issue Sep 8, 2022
An non-recursive list_modify()

Fixes #822
hadley added a commit that referenced this issue Sep 9, 2022
A non-recursive list_modify()

Fixes #822
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement list 🧦
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants