I'm trying to build a new vector class in R with the vctrs
package and can not get c()
to work correctly.
c(my_vector_class, character())
correctly calls vec_c
, but c(character(), my_vector_class)
ignores any and all vctrs
coersion rules I am trying to implement.
Is it generally impossible to control coersion with c()
when the new class is not the first argument, or should I keep trying to debug this?
It says in the vignette: "You’ll also get mostly correct behaviour for c(). The exception is when you use c() with a base R class". Does that mean that there's no way to control the behaviour of c(some_base_class, ,my_vctrs_class)
?
Thank you
question from:
https://stackoverflow.com/questions/66052949/vec-c-not-called-when-vctrs-object-is-not-the-first-argument-in-c 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…