Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
225 views
in Technique[技术] by (71.8m points)

r - vec_c not called when vctrs object is not the first argument in c()

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...