Skip to content

[help] vctrs and tar_group clashing when using data.table::as.IDate #1135

Closed Answered by wlandau
robitalec asked this question in Help
Discussion options

You must be logged in to vote

As you say, iteration = "list" should work for now.

It is tricky to make iteration = "vector" aggregation fully general. The code is here:

targets/R/class_vector.R

Lines 16 to 19 in 0219806

value_produce_aggregate.tar_vector <- function(value, objects) { # nolint
objects$.name_spec <- "{outer}_{inner}"
do.call(vctrs::vec_c, objects)
}

Sometimes vctrs::vec_c() name spec is required:

vctrs::vec_c(a = c(1, 2), b = c(3, 4, 5))
#> Error in `vctrs::vec_c()`:
#> ! Can't merge the outer name `a` with a vector of length > 1.
#> Please supply a `.name_spec` specification.

But other times, as in your case, the name spec causes problems:

vctrs::vec_c(
  a = data.table::

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@robitalec
Comment options

Answer selected by robitalec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants