Thanks to visit codestin.com
Credit goes to github.com

Skip to content

targets markdown chunks error strangely and fire early when named 'setup' #973

@KaiAragaki

Description

@KaiAragaki

Discussed in #972

Originally posted by KaiAragaki November 4, 2022

```{r}
library(targets)
tar_unscript()
```
```{targets setup}
tar_target(foo, "bar")
```
Registered S3 method overwritten by 'data.table':
  method           from
  print.data.table
Error in if (record) "enable" else "inhibit" : argument is of length zero

Things to note:

  1. This does not happen with r chunks
  2. This only happens with chunks named 'setup' - not 'setu' or 'setups'
  3. Including a chunk with this name causes it to fire 'early' - even running the first chunk causes the setup chunk to be run.

If this is a privileged chunk name, it may be nice to have a clearer error.

(Beautiful package by the way. Really one of my favorites of all time.)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions