vctrs objects loose names when apply is used on them
thomasp85 opened this issue · comments
Thomas Lin Pedersen commented
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
Davis Vaughan commented
I think this is actually a duplicate of #1416