You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As far as I can tell there is no way to have vec_c() return autoscaled units because:
let's say we're combining x and y
vctrs::vec_ptype2 finds the common type between x and y
vctrs::vec_cast() casts each x and y independently to the common type determined by vec_ptype2
here's the rub: vec_ptype2 DOES not get the whole vectors x and y with the data in it but only the object types (essentially whatever vec_slice(x, 0L) returns)
here's the problem then: to determine the ideal auto-scaling for a combined x and y we'd need to have the data so we can calculate the median and decide on the ideal prefix for the combined vector, neither vec_ptype2 nor vec_cast has all the information (vec_ptype2 has the units but not the actual numbers, vec_cast only has the units of one at a time) to do this correctly so I do not see any way for vec_c()/bind_rows to autoscale
result: vec_c() can only scale to the ideal prefix of one of the vectors (calculations are correct but autoscaling doesn't work)
Question then: currently c() does autoscale (because it has all the info and thus can) but should this be it's behaviour?? (leads to vec_c() and c() scaling differently)
The text was updated successfully, but these errors were encountered:
As far as I can tell there is no way to have
vec_c()
return autoscaled units because:x
andy
vctrs::vec_ptype2
finds the common type betweenx
andy
vctrs::vec_cast()
casts eachx
andy
independently to the common type determined byvec_ptype2
vec_ptype2
DOES not get the whole vectorsx
andy
with the data in it but only the object types (essentially whatevervec_slice(x, 0L)
returns)x
andy
we'd need to have the data so we can calculate the median and decide on the ideal prefix for the combined vector, neithervec_ptype2
norvec_cast
has all the information (vec_ptype2
has the units but not the actual numbers,vec_cast
only has the units of one at a time) to do this correctly so I do not see any way forvec_c()
/bind_rows
to autoscalevec_c()
can only scale to the ideal prefix of one of the vectors (calculations are correct but autoscaling doesn't work)Question then: currently
c()
does autoscale (because it has all the info and thus can) but should this be it's behaviour?? (leads tovec_c()
andc()
scaling differently)The text was updated successfully, but these errors were encountered: