-
Hello, I pepper my targets list with tests, which basically check that a particular target passes certain tests. Here's an example -
Here's a result -
Now, I have many of these tests, which are all named according to the pattern
I would like to combine all these result dataframes into a combined dataframe.
All of these targets have the same structure. I would like to add more test targets and not think about adding them to the test_results target Unfortunately, I'm having trouble passing the list of test targets to the Is there a way to do this that I'm missing? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Target objects generated by Or, if you are not using # _targets.R
library(targets)
library(tarchetypes)
other_targets <- list(
tar_target(x, ...)
tar_target(y,...)
...
)
testing_targets <- list(
tar_target(a.test, ...)
tar_target(b.test, ...)
)
testing_results <- tar_combine(results, testing_targets)
# Full list of targets:
list(
other_targets,
testing_targets,
testing_results
) Another option is to use dynamic branching because it automatically combines data frame return values. I would advise against using |
Beta Was this translation helpful? Give feedback.
-
Thanks, the separate lists works well. |
Beta Was this translation helpful? Give feedback.
Target objects generated by
tar_map()
have names, so you could pre-filter the output oftar_map()
and feed that totar_combine()
.Or, if you are not using
tar_map()
, you could write your testing targets in a separate list and feed that totar_combine()
.Another option is to use dynamic branching because it automatically combines data frame return…