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

vctrs objects loose names when apply is used on them #1914

Closed
thomasp85 opened this issue Mar 1, 2024 · 1 comment
Closed

vctrs objects loose names when apply is used on them #1914

thomasp85 opened this issue Mar 1, 2024 · 1 comment

Comments

@thomasp85
Copy link
Member

It appears vctrs objects will throw away their names when mapped over, in contrast to how names generally behaves with mapping (the names is transferred to the result)

names(lapply(vctrs::new_vctr(list(a = 1, b = 2)), identity))
#> NULL
names(lapply(list(a = 1, b = 2), identity))
#> [1] "a" "b"

This is due to as.list() throwing away the names

@DavisVaughan
Copy link
Member

I think this is actually a duplicate of #1416

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants