The targets package is a pipeline toolkit for Make-like declarative workflows in R. Please visit the documentation website at https://wlandau.github.io/targets/ for more information.
Questions tagged [targets-r-package]
50 questions
3
votes
2 answers
static image of targets workflow, programatically
I'm trying to embed a static image of a targets workflow in an rmarkdown document. I tried to do this by using tar_mermaid, defining a target that writes the workflow in mermaid format mm <- tar_mermaid(); writeLines(mm, "target_mermaid.js") but the…

Ben Bolker
- 211,554
- 25
- 370
- 453
3
votes
1 answer
targets::tar_map() example? (R targets static branching)
Does anyone have an example of how to use static branching from the targets package (R)?
I'm reading targets manual on static branching but I'm having a hard time understanding it (even though I do get dynamic…

arnle
- 480
- 4
- 10
3
votes
0 answers
R {targets} package: how to refer to an existing target using a string?
I'm using the {targets} package, trying to create new targets based on existing targets. Whereas it's simple to refer to an existing target by typing its name in NSE-style, I fail to do the same by using a character string as "alias".
Just to be…

Emman
- 3,695
- 2
- 20
- 44
3
votes
1 answer
How should I use {targets} when I have multiple data files
I have ~50 data files (subjects) that I process individually before I combine them in a data.frame for modelling. I'm unsure how to best use {targets} for this.
I tried using dynamic branching, but I'm unsure how to keep track of subject IDs with…

JohannesNE
- 1,343
- 9
- 14
3
votes
1 answer
R targets with H2O
I use targets as a pipelining tool for an ML project with H2O.
The main uniqueness of using H2O here is that it creates a new "cluster" (basically a new local process/server which communicates via Rest APIs as far as I understand).
The issue I am…

David
- 9,216
- 4
- 45
- 78
2
votes
2 answers
Validating successful execution of R scripts from top to bottom in a clean session without errors
I teach multiple R Courses where students have to submit an analysis they did on a specific dataset. As a first, (small) step towards reproducibility, I want to make sure the script they are submitting ran at least once on their local computer with…

Ratnanil
- 1,641
- 17
- 43
2
votes
1 answer
Using `tryCatch` in a `targets` pipeline: R
I'm building an R package and using the targets package to run tests systematically. I expect errors and want the targets output to save the errors (and other objects created along the way) rather than prevent the pipeline from proceeding past the…

QAsena
- 603
- 4
- 9
2
votes
1 answer
No visible global function definition/no visible binding for global variable in a project?
I'm working with R in VS Code, using the R Extension. I do almost all of my project work using targets, which means that my package imports and functions are usually in separate files.
A simple example would be working in a folder which looks…

Taren Sanders
- 421
- 2
- 12
2
votes
1 answer
R read target programmatically
I have a set of targets, lets say data_a, data_b, ...
I want to iterate over all datasets and load the data.
This can be achieved using tar_read(data_a) or tar_read(data_a"). As I want to load the targets programmatically, I would like to use…

David
- 9,216
- 4
- 45
- 78
2
votes
0 answers
How to use iteration when creating new targets with `targets::tar_target()` based on existing targets
I'm using the {targets} package in a data analysis project where I need to fetch datasets from a remote Oracle database.
My overarching task is twofold:
get data from scattered over different views and tables in the Oracle DB.
compute and wrangle a…

Emman
- 3,695
- 2
- 20
- 44
2
votes
1 answer
How do you use the interactive R Markdown abilities of the `targets` package
I am attempting to use the interactive Markdown functionality provided by the targets package in R (more information here: https://books.ropensci.org/targets/markdown.html). I'm using the template R Markdown file, which builds a pipeline for…

Jake
- 196
- 1
- 18
2
votes
1 answer
Using R Targets to Append New Data to Exisiting Data
I'm using a targets workflow pipeline. Part of this pipeline is to monitor a directory of csv files for updates. There are more than 10,000 csv files in this directory, and new files are added weekly. I want to be able to identify the newly added…

kputschko
- 766
- 1
- 7
- 21
2
votes
1 answer
Cannot render distill article in a targets pipeline
I'm new to targets ecosystem. I could not create a distill article from my targets pipeline although it works when I set the output to html_document in yaml. I have tried googling but couldn't find anything useful. Any help would be appreciated.
My…

Zaw
- 1,434
- 7
- 15
2
votes
1 answer
Preferred approach for making the `{targets}` R package detect changes to functions and exported datasets from my own developed R data package
I am a beginner with the {targets} package, and I was wondering what is the right setup to register dependencies to functions (and datasets) developed by myself in an R data package.
My idea is to use {targets} to develop the somewhat involved…

Ramiro Magno
- 3,085
- 15
- 30
1
vote
2 answers
Targets dynamic branching to add columns to matrix
I have multiple rasters in a R targets pipeline that I load with tar_files() and then iterate over it in the next target to add one column per file to a matrix. However, only the first column is created. Here is a reprex without using…

Josep Pueyo
- 387
- 2
- 11