R/class_list.R

Defines functions value_produce_aggregate.tar_list value_produce_slice.tar_list value_count_slices.tar_list list_new

list_new <- function(object = NULL) {
  enclass(environment(), c("tar_list", "tar_value"))
}

#' @export
value_count_slices.tar_list <- function(value) {
  length(value$object)
}

#' @export
value_produce_slice.tar_list <- function(value, index) {
  value$object[[index]]
}

#' @export
value_produce_aggregate.tar_list <- function(value, objects) { #nolint
  objects
}

Try the targets package in your browser

Any scripts or data that you put into this service are public.

targets documentation built on Oct. 12, 2023, 5:07 p.m.