graph TB
data[Data<br>in a file] -->|?| tab_desc[Product 1:<br>Descriptive<br>statistics<br>table]
tab_desc -->|insert| paper[Product 3:<br>Paper]
data -->|?| plot_distrib[Product 2:<br>Basic<br>visualization]
plot_distrib -->|insert| paper
18 Setting up automatic analysis pipelines
When doing analyses on data, you have probably experienced (many) times where you have to re-run some analyses and have forgotten the order that code should run or which parts you need to re-run in order to update the results. Things can get confusing quickly, even in relatively simple projects. This becomes even more challenging when you return to a project after a month or two and have forgotten the state of the analysis and the project as a whole. Add in collaborators, and things can get even more complex.
That’s where formal data analysis pipeline tools come in. By organising your analyses into distinct steps, with clear inputs and outputs, and adding these steps to a pipeline that tracks them, you can make things a lot easier for yourself and others. This session focuses on using tools that create and manage these pipelines effectively.
18.1 Learning objectives
- Describe the computational meaning of pipeline and how pipelines are often used in research.
- Explain the difference between a “function-oriented” workflow and a “script-oriented” workflow, and why the function-based approach is a more powerful approach to doing analyses.
- Describe a design-driven approach to building the pipeline step by step, to help manage complexity and help you focus on testing and building the pipeline at each stage.
- Setup an analysis pipeline using targets that clearly defines each step of your analysis—from raw data to finished manuscript—that makes updating your analysis by you or your collaborators as simple as running a single function.
18.2 💬 Discussion activity: How do you re-run analyses when something changes?
Time: ~10 minutes.
We’ve all been (or will be) in situations where something in our analysis needs to change: Maybe we forgot to remove a certain condition (like unrealistic BMI values), maybe our supervisor suggests something we hadn’t considered in our analysis, or maybe during peer review of our manuscript, a reviewer makes a suggestion that would improve the paper.
Whatever the situation, we inevitably need to re-run parts of or the full analysis. So what is your exact workflow when you need to re-run code and update your results? Assume it’s a change in the code somewhere early in the data processing stage.
- Take about 1 minute to think about the workflow you use. Try to think of the exact steps you need to take, what exactly you do, and how long that usually takes.
- For 6 minutes, share and discuss your thoughts in with your neighbour. How do your experiences compare to each other?
- For the remaining time, we’ll briefly share with everyone what they’ve thought and discussed.
18.3 📖 Reading task: What is a data analysis “pipeline”?
Time: ~10 minutes.
After they finish reading this section, briefly walk through it. In particular, emphasize what we want to make at the end, even though that goal might change as the analysis project progresses.
A pipeline can be any process where the steps between a start and an end point are clearly and explicitly defined. These distinct steps could be fully manual (needing a human present) or automated by a robot or computer, or be a mix of manual and automated. For example, in car factories, the pipeline from the input raw materials to the final vehicle is very well defined and implemented, with a mix of automated and manual steps along the pipeline.
In research, especially around data collection and analysis, you may often hear or read about “pipelines”. Unfortunately, when more closely examined, they often are vague or poorly described. Instead, they are usually better described as general workflows rather than precise pipelines. This disconnect in the correct use of terms comes largely from lack of awareness or expertise in the area, in particular when it comes to descriptions of computational pipelines. There are many systemic reasons for this lack of awareness and expertise, which have already been (briefly) mentioned in the syllabus and introduction session.
In computational environments, a pipeline is a set of data processing steps connected in a series with a specific order; the output of one step is the input to the next. The pipeline is also written in a programming language that provides explicit instructions in the computer. For computational pipelines, there should realistically be no human intervention from raw input to finished product when the pipeline has been built. The entire process should be computationally reproducible.
Before we get to what an actual data analysis pipeline looks like in practice, we have to separate two things: exploratory data analysis and data analysis for the final paper. In exploratory data analysis, there will likely be a lot of manual, interactive steps involved that may or may not need to be explicitly stated and included in the analysis plan and pipeline.
But for the final paper with the results, you generally have some basic first ideas of what you’ll need or want for the paper. And when working on projects, it’s good practice to follow the principle “start at the end and work backwards.” This means to think about and design what your final product will be and what it (generally) will contain. In research products like papers, you usually have several tables and figures in the paper. Those are “sub-products” of the main “product”. So let’s list a few “sub-products” (that we’ll just call “products”) that you almost always have in a research paper:
- A table of some basic descriptive statistics of the study population, such as mean, standard deviation, or counts of basic discrete data (like treatment group). Usually this is a “table 1” in the paper.
- One or more figures showing some basic distributions or charts of the main variables of interest, such boxplots or scatterplots of the outcomes with the predictors. Like with the table above, this is usually “figure 1” or a similar early figure in the paper.
- Lastly, the paper with the above table and figure included.
Let’s break this down visually in Figure 18.1:
Here, there are three distinct “products” that you (might) want to create from your data. Each “flow” from data to the desired product has specific actions that need to happen. Now that you’ve seen how it is conceptually drawn out, you have some initial tasks to work towards in your pipeline. In this session, we will setup up and design the pipeline so that we can eventually build up the actions piece-by-piece to go from data to final product.
18.4 Using targets to manage a pipeline
There are a few packages that help build pipelines in R, but the most commonly used, well-designed, and maintained one is called targets. This package allows you to explicitly set “targets” (objects like the table or figure) you want to create as part of the pipeline. targets will then track all your targets for you and tracks which output a target is input to another target as well as which target need to be updated when you make changes to your pipeline.
Ask participants, which do they think it is: a build dependency or a workflow dependency. Because it is directly used to run analyses and process the data, it would be a build dependency.
First, we need to install and add targets to our dependencies. Since targets is a build dependency, we’ll add it to the DESCRIPTION file with:
Console
use_package("targets")Now that it’s added as a dependency, let’s set up our project to start using targets! There’s a handy helper function that does this for us:
Console
targets::use_targets()This command will create a _targets.R script file that we’ll use to define our analysis pipeline. Before we do that though, let’s commit the file to the Git history with Ctrl-Alt-MCtrl-Alt-M or with the Palette (Ctrl-Shift-PCtrl-Shift-P, then type “commit”).
18.5 📖 Reading task: Inside the _targets.R file
Time: ~8 minutes.
Let them read it before going over it again to reinforce the function-oriented workflows and how targets and the tar_target() work. In particular emphasise the relationship between the targets list(tar_target(...), ...), the function-oriented workflow, and the graph.
For this reading task, you’ll take a look at what _targets.R contains. So, start by opening it on your computer.
Mostly, the _targets.R script contains comments and a basic set up to get you started. But notice the tar_target() function used at the end of the script. There are two main arguments for it: name and command. The way that targets works is similar to how you’d assign the output of a function to an object, so:
object_name <- function_in_command(input_arguments)Is the same as:
tar_target(
name = object_name,
command = function_in_command(input_arguments)
)What this means is that targets follows a “function-oriented” workflow, not a “script-based” workflow. What’s the difference? In a script-oriented workflow, each R file/script is run in a specific order. As a result, you might end up with a “main” R file that has code that looks like:
Where it will run each of these R scripts in a specific order. Meanwhile, in a function-oriented workflow, it might look more like:
source("R/functions.R")
raw_data <- load_raw_data("file/path/data.csv")
processed_data <- process_data(raw_data)
basic_stats <- calculate_basic_statistics(processed_data)
simple_plot <- create_plot(processed_data)With the function-oriented workflow, each function takes an input and contains all the code to create one result as its output. This could be, for instance, a figure in a paper.
If you’ve taken the intermediate R workshop, you’ll notice that this function-oriented workflow is the workflow we covered in that workshop. There are so many advantages to this type of workflow which is why many powerful R packages are designed around making use of it.
If we take the same code as above and convert it into the targets format, the end of _targets.R would like this:
list(
# This part is special, as it tells targets that the
# character string is a file path.
tar_target(
name = data_file,
command = "file/path/data.csv",
format = "file"
),
tar_target(
name = raw_data,
command = load_raw_data(data_file)
),
tar_target(
name = processed_data,
command = process_data(raw_data)
),
tar_target(
name = basic_stats,
command = calculate_basic_statistics(processed_data)
),
tar_target(
name = simple_plot,
command = create_plot(processed_data)
)
)So, each tar_target() is a step in the pipeline. The command is the function call, while the name is the name of the output of the function call.
In order for targets to effectively track, or “watch”, changes to a file, we have to tell it that a target is a file by using the format = "file" argument. This way, if the file changes, targets knows that it needs to re-run any targets that depend on it.
This relationship between objects and functions (because of the function-oriented workflow) can be represented exactly as a graph, with nodes and arrows. Each node is an R object and each arrow is the function that converts that object to another object. Since the targets pipeline is structured using a function-oriented workflow, the pipeline can also be visually represented as a graph, which we show in Figure 18.2.
graph TB
data_file -->|"load_raw_data()"| raw_data
raw_data -->|"process_data()"| processed_data
processed_data -->|"calculate_basic_statistics()"| basic_stats
processed_data -->|"create_plot()"| simple_plot
And in fact, targets has some functionality to visually generate a graph of the targets and their connections, which we will cover later in this session.
18.6 Designing pipelines backwards
Visually walk through this section, showing the products we want, highlighting the diagram and why we make these diagrams, and emphasizing the function-oriented workflow. Part of a function-oriented workflow is making these diagrams that explicitly show the steps (the functions) that transform one object to another.
Now that we’ve conceptually read through how targets works, let’s take a big step back and first graphically design our own pipeline. As we covered in Figure 18.1, we had three “products” that we wanted to create.
- A table of basic descriptive statistics, which we’ll call
table_descriptive_stats. - A plot of our variables of interest, which we’ll call
plot_counts. - A report (Quarto document). We’ll call it
report.
Using the principle of “start at the end” and work backwards, we’ll start with report. Let’s add a box for our product in a diagram (you can also sketch this out very effectively with pen and paper too).
graph BT
report
Next, we have our two other products, the table and the figure. Both of them will be inserted into the report. So let’s add them and connect them to report with an arrow. We’ll use ? to indicate that we don’t yet know how these products will get into the report.
graph BT
table_descriptive_stats -->|"?"| report
plot_counts -->|"?"| report
Now, in order to make the table and figure, we need the data! Unlike the table and the figure that have their own boxes in the diagram, data actually has two: One for the data in the file, and one for data loaded into R. Let’s add these as well as including the (potential) functions that will create each product/box in the design. Between the boxes, as labels to the arrows, are the names of the functions we’ll eventually create that will make the products.
graph BT
data_file["data_file<br>'data/cv-risk.csv'"] -->|"read_csv()"| cv_risk
cv_risk -->|"create_table_descriptive_stats()"| table_descriptive_stats
cv_risk -->|"create_plot_counts()"| plot_counts
table_descriptive_stats -->|"?"| report
plot_counts -->|"?"| report
This is our starting point for building up the pipeline. When we get to adding analysis products, you’ll get a chance to brainstorm a design for adding new analysis products to the pipeline. In this session, we’ll add the final report product and reading in the cv_risk data into the targets pipeline as well as loading the data in the docs/report.qmd file.
18.7 Building up our first target
The very first target we want to create is to load in data from a file. So let’s add it as a step in the targets pipeline. Open up the _targets.R file and go to the end of the file, where the list() and tar_target() code is found. Delete all but one of the tar_target() inside the list().
To track the actual data file, we will need to create a pipeline target that defines the location of our file by using the argument format = "file". This tells targets that the target is a file and to keep track of the file itself to watch for changes to it.
_targets.R
list(
tar_target(
name = file,
command = "data/cv-risk.csv",
format = "file"
)
)Let’s run targets to see what happens! You can either use the Palette (Ctrl-Shift-PCtrl-Shift-P, then type “targets run”) or run this code in the Console:
Console
targets::tar_make()For the rest of the workshop we will use the Palette (Ctrl-Shift-PCtrl-Shift-P, then type “targets run”) (the “foreground” one) rather than the function in the Console.
After running it, you should see in one of RStudio’s panes something that looks like:
+ file dispatched
✔ file completed [4ms, 24.28 kB]
✔ ended pipeline [123ms, 1 completed, 0 skipped]
This tells us that the target called file has been run. Since we only have one target, that’s all that targets could run.
We also see that a new folder has been created called _targets/. Inside this folder targets keeps all of the output from running the code in _targets.R. It comes with its own .gitignore file so that you don’t track all the files inside, as they don’t need to be tracked. While targets recommends committing _targets/meta/meta into the Git history, in the context of this workshop, we will tell Git to ignore it. That’s because it can lead to some confusion about what it contains and how to use it when working with others. So let’s use use_git_ignore() to ignore it.
Console
use_git_ignore("_targets/meta/meta")We can visualize our pipeline now too! This can be useful as you add more and more targets. We will (likely) need to install an extra package (done automatically):
Console
targets::tar_visnetwork()We can also use the Palette (Ctrl-Shift-PCtrl-Shift-P, then type “targets visual”), which is what we will use for the rest of the workflow rather than the Console command.
Walkthrough and explain the visualisation. Take your time moving things around, zooming in and out, and clicking around.
If you want to check which targets are outdated, we use:
Console
targets::tar_outdated()Or by using the Palette (Ctrl-Shift-PCtrl-Shift-P, then type “targets outdated”).
Now, let’s actually load in the data as a target. We’ll create a new tar_target() that reads in the data using readr::read_csv(), using the file target as input. In the _targets.R file at the list() section at the bottom, add another tar_target() that looks like:
Notice we use readr:: with the ::. That’s because we don’t want to load it with library() and instead explicitly tell R which package to get the function from. Especially in the context of targets, using the explicit namespacing (using ::) for functions can substantially reduce bugs and issues when building and running pipelines.
We use show_col_types = FALSE to suppress the message explaining which columns readr is reading into R. Now, let’s run targets again using the Palette (Ctrl-Shift-PCtrl-Shift-P, then type “targets run”). It should now also show something like:
+ cv_risk dispatched
✔ cv_risk completed [109ms, 4.88 kB]
✔ ended pipeline [234ms, 1 completed, 1 skipped]
After it runs, check the visualisation of it with the Palette (Ctrl-Shift-PCtrl-Shift-P, then type “targets visual”). You can now see that there are two targets, with an arrow from file to cv_risk.
Walkthrough this again, this time showing the new target that was added and the arrow between the targets.
How can we access that new cv_risk data that targets created? For that, we use the function targets::tar_read(). targets stores the output of each target in its own internal storage system, which is kept in the _targets/ folder. So when we use targets::tar_read(), we access any stored target items using syntax like we would with dplyr, without quotes.
So in the Console, let’s see how our data looks like by running:
Console
targets::tar_read(cv_risk)# A tibble: 500 × 19
patient_id gender age systolic_blood_pressure total_cholesterol
<chr> <chr> <dbl> <dbl> <dbl>
1 CARD-00001 men 46 127. 249.
2 CARD-00002 men 54 122. 226
3 CARD-00003 men 47 140. 179.
4 CARD-00004 women 75 163. 267
5 CARD-00005 women 66 129. 199.
6 CARD-00006 women 82 147. 245.
7 CARD-00007 men 67 137. 253.
8 CARD-00008 men 55 125. 196
9 CARD-00009 women 41 90 168.
10 CARD-00010 women 63 175. 246.
# ℹ 490 more rows
# ℹ 14 more variables: high_density_lipoprotein <dbl>,
# low_density_lipoprotein <dbl>, body_mass_index <dbl>, hba1c <dbl>,
# smoking <lgl>, diabetes <lgl>, hypertension <lgl>,
# atrial_fibrillation <lgl>, family_history_cvd <lgl>,
# alcohol_use <lgl>, score2_10y <dbl>, ascvd_pce_10y <dbl>,
# outcome_any_cv_event <lgl>, outcome_death <lgl>
We use this syntax whenever we want to output or print a target object, including for tables and figures.
We’re now ready to start building our first item/product! But first, since we finished writing some code, let’s style _targets.R using the Palette (Ctrl-Shift-PCtrl-Shift-P, then type “style file”). Before continuing, let’s commit the changes we’ve made (including the files in the _targets/ folder) by putting it to the Git history with Ctrl-Alt-MCtrl-Alt-M or with the Palette (Ctrl-Shift-PCtrl-Shift-P, then type “commit”). Then push the changes to GitHub.
18.8 Adding Quarto as a target
Let’s create the “end” of the pipeline first. But, how do we add a Quarto file as a target? If we try to look through the targets documentation, we won’t find anything specific for Quarto files. However, there is a helper package called tarchetypes that contains functions that make it easier to add specific types of files as targets, including Quarto files.
Open up the _targets.R file. You can see at the top of the _targets.R file that there is a commented out line for loading the tarchetypes package. So let’s uncomment that line so that it looks like this now:
_targets.R
# Load packages required to define the pipeline:
library(targets)
library(tarchetypes)We don’t have the tarchetypes package installed yet, so let’s install it by going to the Console and using use_package("tarchetypes"). Because it is a required package for our targets pipeline, it would be considered a build dependency.
Console
use_package("tarchetypes")Now, let’s go back to the _targets.R file and go to the bottom of the file with the list() of tar_target() items. We will now add the new item for rendering the Quarto file that is called tar_quarto(). Like tar_target(), this takes a name argument. But unlike having a command argument like in tar_target(), tar_quarto() takes a path argument where you write the file path to the Quarto file. Let’s add it:
_targets.R
list(
# ...,
tar_quarto(
name = report,
path = "docs/report.qmd"
)
)Let’s run targets::tar_make() with the Palette (Ctrl-Shift-PCtrl-Shift-P, then type “targets run”) to build the Quarto document. However, we will probably get an error because we haven’t installed the quarto R package yet.
So let’s install the quarto R package to help targets connect to the Quarto file. Again, because this is required by the targets pipeline, this is a build dependency.
Console
use_package("quarto")Let’s build the pipeline with the Palette (Ctrl-Shift-PCtrl-Shift-P, then type “targets run”) again. It should work! 🎉 Let’s also check the visualization of the pipeline with the Palette (Ctrl-Shift-PCtrl-Shift-P, then type “targets visual”). You should now see the report target at the end of the pipeline. Notice how report isn’t connected to cv_risk. Let’s connect them.
18.9 Including target output in a Quarto document
We haven’t added anything to the docs/report.qmd file yet. It’s basically an empty Quarto file. How might we, for example, load the data? The pipeline has code that reads in the data as the cv_risk target, right? How can we use that in the Quarto document?
Open up the docs/report.qmd file and go to the code chunk called setup (should look like {r setup}). If there isn’t one, create a new code chunk with Ctrl-Alt-ICtrl-Alt-I or with the Palette (Ctrl-Shift-PCtrl-Shift-P, then type “new chunk”) at the bottom of the file and name the code chunk setup.
Since we’ll be using some targets functions in this Quarto document, let’s add library(targets) to the setup code chunk. Now, in order use the cv_risk data that we added to the _targets.R pipeline, which has been stored in the the _targets/ target “store” folder, we use tar_read() to read it in and assign it to the cv_risk object. It looks like:
docs/report.qmd
```{r setup}
library(targets)
cv_risk <- tar_read(cv_risk)
```Let’s try to render this right now by using Ctrl-Shift-KCtrl-Shift-K or with the Palette (Ctrl-Shift-PCtrl-Shift-P, then type “render”). We will likely get an error saying something about not finding the targets “store”. This is because when we use a targets function like tar_read() in a Quarto document, Quarto will look for a folder called _targets/ in the same folder that the Quarto document is in (which is where the R session is created in). When we render a Quarto document, the default location for the R session is the folder where the Quarto file is located, which is docs/. We don’t have a folder called docs/_targets/. Instead, _targets/ is in the root of the project.
So we have to tell targets where to find the store, which we can do by using targets::tar_config_set(). This function allows us to set various configuration options for targets. One of these options is store, which we can use to tell targets where the _targets/ store is located relative to the Quarto file.
So in the setup code chunk, we’ll add the tar_config_set() line right after library(targets). Since the Quarto file is in the docs/ folder, we can use here::here() to point to "_targets" to point to the store.
docs/report.qmd
```{r setup}
library(targets)
tar_config_set(store = here::here("_targets"))
cv_risk <- tar_read(cv_risk)
```Let’s try to render the file now with Ctrl-Shift-KCtrl-Shift-K or with the Palette (Ctrl-Shift-PCtrl-Shift-P, then type “render”). It should work now without any errors! 🎉 Great! Now let’s run our pipeline again with the Palette (Ctrl-Shift-PCtrl-Shift-P, then type “targets run”).
When we run the pipeline with the Quarto target in it, we’ll see that a new file is created in the docs/ folder. When we use targets::tar_config_set(store = ...), it creates a new file called _targets.yaml that tells targets where to find the store. We don’t really need to track these files as they are automatically created, so let’s tell Git to ignore them.
Console
use_git_ignore("_targets.yaml")We also have several files that are created that we don’t need to track, like the HTML files and the docs/report_html/ folder. Since these two are automatically generated when we run the targets pipeline, let’s ignore them too. We can use * to tell .gitignore to ignore all folders that end with _files or .html:
Console
use_git_ignore("*_files")
use_git_ignore("*.html")Great! Let’s check the visualization again with the Palette (Ctrl-Shift-PCtrl-Shift-P, then type “targets visual”). The box for the report should now be connected to the cv_risk box. To end, let’s commit the changes we’ve made to our project into the Git history with Ctrl-Alt-MCtrl-Alt-M or with the Palette (Ctrl-Shift-PCtrl-Shift-P, then type “commit”) and push to GitHub.
Returning to our diagram, we can fill in some more details as we’ve built up some pieces of it. Importantly, we know about using targets::tar_read() to read target output within our Quarto document.
graph BT
data_file["data_file<br>'data/cv-risk.csv'"]:::done -->|"read_csv()"| cv_risk:::done
cv_risk -->|"create_table_descriptive_stats()"| table_descriptive_stats:::wip
cv_risk -->|"create_plot_counts()"| plot_counts:::wip
table_descriptive_stats -->|"tar_read()"| report:::wip
plot_counts -->|"tar_read()"| report:::wip
classDef done stroke-width:3px
classDef wip fill:#ffedd6
18.10 📖 Reading task: Fixing issues in the stored pipeline data
Time: ~10 minutes.
Sometimes you need to start from the beginning and clean everything up because there’s an issue that you can’t seem to fix. In this case, targets has a few functions to help out. Here are four that you can use to delete stuff (also described on the targets book):
tar_invalidate()-
This removes the metadata on the target in the pipeline, but doesn’t remove the object itself (which
tar_delete()does). This will tell targets that the target is out of date, since it has been removed, even though the data object itself isn’t present. You can use this like you wouldselect(), by naming the objects directly or using the tidyselect helpers. For example,tar_invalidate(everything())will remove all metadata details for all targets in the pipeline, andtar_invalidate(starts_with("data_"))will remove all metadata details for targets that start withdata_. tar_delete()-
This deletes the stored objects (e.g. the
cv_riskobject) inside_targets/, but does not delete the record in the pipeline. So targets will see that the pipeline doesn’t need to be rebuilt. This is useful if you want to remove some data because it takes up a lot of space, or, in the case of GDPR and privacy rules, you don’t want to store any sensitive personal health data in your project. Use it liketar_invalidate(), with functions likeeverything()orstarts_with(). For example,tar_delete(everything())will delete all stored objects in_targets/andtar_delete(starts_with("data_"))will delete all stored objects that start withdata_. tar_prune()-
This function is useful to help clean up left over or unused objects in the
_targets/folder. You will probably not use this function too often. tar_destroy()-
The most destructive, and probably more commonly used, function. This will delete the entire
_targets/folder for those times when you want to start over and re-run the entire pipeline again.
18.11 Summary
Design pipelines by starting from the end and working backwards.
Use a function-oriented workflow together with targets to build your data analysis pipeline and track your pipeline “targets”.
Build up targets piece by piece. Let targets save the pipeline output and store the results for you, rather than keep them in your Git history.
List individual “pipeline targets” using
tar_target()within the_targets.Rfile and run them withtargets::tar_make().Visualize target items in your pipeline with
targets::tar_visnetwork()or list outdated items withtargets::tar_outdated().Use
targets::tar_read()to access saved pipeline outputs, whether in the Console or in Quarto documents pipeline outputs.Include Quarto documents in the pipeline by using tarchetypes and the function
tar_quarto().
18.12 Survey
Please complete the survey for this session:
18.13 Code used in session
This lists some, but not all, of the code used in the section. Some code is incorporated into Markdown content, so is harder to automatically list here in a code chunk. The code below also includes the code from the exercises.
use_package("targets")
targets::use_targets()
list(
tar_target(
name = file,
command = "data/cv-risk.csv",
format = "file"
)
)
targets::tar_make()
use_git_ignore("_targets/meta/meta")
targets::tar_visnetwork()
targets::tar_outdated()
list(
tar_target(
name = file,
command = "data/cv-risk.csv",
format = "file"
),
tar_target(
name = cv_risk,
command = readr::read_csv(file, show_col_types = FALSE)
)
)
targets::tar_read(cv_risk)
use_package("tarchetypes")
list(
# ...,
tar_quarto(
name = report,
path = "docs/report.qmd"
)
)
use_package("quarto")
use_git_ignore("_targets.yaml")
use_git_ignore("*_files")
use_git_ignore("*.html")