r-lib/rray

`vec_cast()` should preserve dim names

Opened this issue · 1 comments

Follow whatever strategy we end up with here

r-lib/vctrs#623

If we end up recycling names when doing a cast that requires broadcasting, it might make sense to make rray_broadcast() also recycle names. Meaning these should be aligned.

vctrs::vec_cast(
  matrix(1, dimnames = list("r1", "c1")),
  matrix(1, ncol = 2)
)
#>    c1 c1
#> r1  1  1

rray::rray_broadcast(
  matrix(1, dimnames = list("r1", "c1")), 
  c(1, 2)
)
#>    [,1] [,2]
#> r1    1    1

Created on 2019-10-17 by the reprex package (v0.2.1)