targets: Last error: igraph::is_dag(graph) is not TRUE

I have the following _targets.R, yet I get an "is not directed acyclic graph" error from the targets package when calling tar_make().

Is the zip file the problem? Is using namespaces instead of loading package the problem?

requireNamespace("targets")
namespaces = c("targets", "readr", "cmdstanr", "bayesplot", "posterior")
targets::tar_option_set(imports = namespaces)
source("R/project.R")
list(
  targets::tar_target(
    name = data_file,
    command = "data/data_file.zip",
    format = "file"),
  targets::tar_target(
    name = data,
    command = readr::read_csv(data_file,
                              col_types = readr::cols())
  )
)

Hi @atxprof,

My first instinct is that the name of your second target data is found in the command of the first target "data/data_file.zip", which creates a cyclical loop because the name of the first target data_file is found in the command of the second target.

What happens if you change the second target name to something else, like data_read or some other disambiguated term?

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.