Skip to content

Commit d76053c

Browse files
committed
differences for PR #70
1 parent 88bf267 commit d76053c

File tree

9 files changed

+142
-212
lines changed

9 files changed

+142
-212
lines changed

basic-targets.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -375,13 +375,13 @@ The following objects are masked from ‘package:datasets’:
375375
376376
penguins, penguins_raw
377377
378-
▶ dispatched target penguins_csv_file
379-
● completed target penguins_csv_file [0.001 seconds, 189 bytes]
380-
▶ dispatched target penguins_data_raw
381-
● completed target penguins_data_raw [0.099 seconds, 10.4 kilobytes]
382-
▶ dispatched target penguins_data
383-
● completed target penguins_data [0.007 seconds, 1.612 kilobytes]
384-
ended pipeline [0.203 seconds]
378+
+ penguins_csv_file dispatched
379+
penguins_csv_file completed [1ms, 189 B]
380+
+ penguins_data_raw dispatched
381+
penguins_data_raw completed [135ms, 10.40 kB]
382+
+ penguins_data dispatched
383+
penguins_data completed [6ms, 1.61 kB]
384+
ended pipeline [363ms, 3 completed, 0 skipped]
385385
```
386386

387387
Congratulations, you've run your first workflow with `targets`!

branch.md

Lines changed: 41 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,9 @@ The following objects are masked from ‘package:datasets’:
9393
9494
penguins, penguins_raw
9595
96-
✔ skipping targets (1 so far)...
97-
▶ dispatched target combined_model
98-
● completed target combined_model [0.012 seconds, 11.2 kilobytes]
99-
▶ ended pipeline [0.121 seconds]
96+
+ combined_model dispatched
97+
✔ combined_model completed [14ms, 11.20 kB]
98+
✔ ended pipeline [121ms, 1 completed, 3 skipped]
10099
```
101100

102101
Let's have a look at the model. We will use the `glance()` function from the `broom` package. Unlike base R `summary()`, this function returns output as a tibble (the tidyverse equivalent of a dataframe), which as we will see later is quite useful for downstream analyses.
@@ -181,22 +180,21 @@ The following objects are masked from ‘package:datasets’:
181180
182181
penguins, penguins_raw
183182
184-
✔ skipping targets (1 so far)...
185-
▶ dispatched target adelie_model
186-
● completed target adelie_model [0.009 seconds, 6.475 kilobytes]
187-
▶ dispatched target gentoo_model
188-
● completed target gentoo_model [0.001 seconds, 5.878 kilobytes]
189-
▶ dispatched target chinstrap_model
190-
● completed target chinstrap_model [0.001 seconds, 4.534 kilobytes]
191-
▶ dispatched target combined_summary
192-
● completed target combined_summary [0.007 seconds, 346 bytes]
193-
▶ dispatched target adelie_summary
194-
● completed target adelie_summary [0.002 seconds, 346 bytes]
195-
▶ dispatched target gentoo_summary
196-
● completed target gentoo_summary [0.002 seconds, 346 bytes]
197-
▶ dispatched target chinstrap_summary
198-
● completed target chinstrap_summary [0.002 seconds, 346 bytes]
199-
▶ ended pipeline [0.155 seconds]
183+
+ adelie_model dispatched
184+
✔ adelie_model completed [13ms, 6.47 kB]
185+
+ gentoo_model dispatched
186+
✔ gentoo_model completed [44ms, 5.88 kB]
187+
+ chinstrap_model dispatched
188+
✔ chinstrap_model completed [2ms, 4.53 kB]
189+
+ combined_summary dispatched
190+
✔ combined_summary completed [6ms, 346 B]
191+
+ adelie_summary dispatched
192+
✔ adelie_summary completed [3ms, 346 B]
193+
+ gentoo_summary dispatched
194+
✔ gentoo_summary completed [3ms, 346 B]
195+
+ chinstrap_summary dispatched
196+
✔ chinstrap_summary completed [4ms, 346 B]
197+
✔ ended pipeline [368ms, 7 completed, 4 skipped]
200198
```
201199

202200
Let's look at the summary of one of the models:
@@ -293,19 +291,13 @@ The following objects are masked from ‘package:datasets’:
293291
294292
penguins, penguins_raw
295293
296-
✔ skipping targets (1 so far)...
297-
▶ dispatched target combined_summary
298-
● completed target combined_summary [0.018 seconds, 346 bytes]
299-
▶ dispatched target penguins_data_grouped
300-
● completed target penguins_data_grouped [0.01 seconds, 1.525 kilobytes]
301-
▶ dispatched branch species_summary_7fe6634f7c7f6a77
302-
● completed branch species_summary_7fe6634f7c7f6a77 [0.006 seconds, 346 bytes]
303-
▶ dispatched branch species_summary_c580675a85977909
304-
● completed branch species_summary_c580675a85977909 [0.003 seconds, 346 bytes]
305-
▶ dispatched branch species_summary_af3bb92d1b0f36d3
306-
● completed branch species_summary_af3bb92d1b0f36d3 [0.003 seconds, 346 bytes]
307-
● completed pattern species_summary
308-
▶ ended pipeline [0.165 seconds]
294+
+ combined_summary dispatched
295+
✔ combined_summary completed [8ms, 346 B]
296+
+ penguins_data_grouped dispatched
297+
✔ penguins_data_grouped completed [5ms, 1.52 kB]
298+
+ species_summary declared [3 branches]
299+
✔ species_summary completed [11ms, 1.04 kB]
300+
✔ ended pipeline [324ms, 5 completed, 3 skipped]
309301
```
310302

311303
There is a series of smaller targets (branches) that are each named like species_summary_7fe6634f7c7f6a77, then one overall `species_summary` target.
@@ -413,17 +405,11 @@ The following objects are masked from ‘package:datasets’:
413405
414406
penguins, penguins_raw
415407
416-
✔ skipping targets (1 so far)...
417-
▶ dispatched target combined_summary
418-
● completed target combined_summary [0.028 seconds, 369 bytes]
419-
▶ dispatched branch species_summary_7fe6634f7c7f6a77
420-
● completed branch species_summary_7fe6634f7c7f6a77 [0.01 seconds, 366 bytes]
421-
▶ dispatched branch species_summary_c580675a85977909
422-
● completed branch species_summary_c580675a85977909 [0.005 seconds, 370 bytes]
423-
▶ dispatched branch species_summary_af3bb92d1b0f36d3
424-
● completed branch species_summary_af3bb92d1b0f36d3 [0.005 seconds, 367 bytes]
425-
● completed pattern species_summary
426-
▶ ended pipeline [0.173 seconds]
408+
+ combined_summary dispatched
409+
✔ combined_summary completed [24ms, 369 B]
410+
+ species_summary declared [3 branches]
411+
✔ species_summary completed [105ms, 1.10 kB]
412+
✔ ended pipeline [320ms, 4 completed, 4 skipped]
427413
```
428414

429415
And this time, when we load the `model_summaries`, we can tell which model corresponds to which row (the `.before = 1` in `mutate()` ensures that it shows up before the other columns).
@@ -584,28 +570,17 @@ The following objects are masked from ‘package:datasets’:
584570
585571
penguins, penguins_raw
586572
587-
✔ skipping targets (1 so far)...
588-
▶ dispatched target penguins_data
589-
● completed target penguins_data [0.023 seconds, 1.525 kilobytes]
590-
▶ dispatched target combined_summary
591-
● completed target combined_summary [0.013 seconds, 369 bytes]
592-
▶ dispatched branch species_summary_1598bb4431372f32
593-
● completed branch species_summary_1598bb4431372f32 [0.009 seconds, 366 bytes]
594-
▶ dispatched branch species_summary_6b9109ba2e9d27fd
595-
● completed branch species_summary_6b9109ba2e9d27fd [0.005 seconds, 370 bytes]
596-
▶ dispatched branch species_summary_625f9fbc7f62298a
597-
● completed branch species_summary_625f9fbc7f62298a [0.005 seconds, 367 bytes]
598-
● completed pattern species_summary
599-
▶ dispatched target combined_predictions
600-
● completed target combined_predictions [0.007 seconds, 25.907 kilobytes]
601-
▶ dispatched branch species_predictions_1598bb4431372f32
602-
● completed branch species_predictions_1598bb4431372f32 [0.008 seconds, 11.581 kilobytes]
603-
▶ dispatched branch species_predictions_6b9109ba2e9d27fd
604-
● completed branch species_predictions_6b9109ba2e9d27fd [0.011 seconds, 6.245 kilobytes]
605-
▶ dispatched branch species_predictions_625f9fbc7f62298a
606-
● completed branch species_predictions_625f9fbc7f62298a [0.005 seconds, 9.624 kilobytes]
607-
● completed pattern species_predictions
608-
▶ ended pipeline [0.238 seconds]
573+
+ penguins_data dispatched
574+
✔ penguins_data completed [24ms, 1.52 kB]
575+
+ combined_summary dispatched
576+
✔ combined_summary completed [14ms, 369 B]
577+
+ species_summary declared [3 branches]
578+
✔ species_summary completed [23ms, 1.10 kB]
579+
+ combined_predictions dispatched
580+
✔ combined_predictions completed [9ms, 25.91 kB]
581+
+ species_predictions declared [3 branches]
582+
✔ species_predictions completed [24ms, 27.45 kB]
583+
✔ ended pipeline [433ms, 9 completed, 2 skipped]
609584
```
610585

611586
::::::::::::::::::::::::::::::::::::: {.callout}

files.md

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ tar_plan(
5555

5656

5757
``` output
58-
▶ dispatched target some_data
59-
● completed target some_data [0.001 seconds, 63 bytes]
60-
ended pipeline [0.079 seconds]
58+
+ some_data dispatched
59+
some_data completed [1ms, 63 B]
60+
ended pipeline [94ms, 1 completed, 0 skipped]
6161
```
6262

6363
If we inspect the contents of `some_data` with `tar_read(some_data)`, it will contain the string `"Hello World"` as expected.
@@ -76,8 +76,7 @@ tar_plan(
7676

7777

7878
``` output
79-
✔ skipping targets (1 so far)...
80-
✔ skipped pipeline [0.066 seconds]
79+
✔ skipped pipeline [49ms, 1 skipped]
8180
```
8281

8382
The target `some_data` was skipped, even though the contents of the file changed.
@@ -97,11 +96,11 @@ tar_plan(
9796

9897

9998
``` output
100-
▶ dispatched target data_file
101-
● completed target data_file [0 seconds, 26 bytes]
102-
▶ dispatched target some_data
103-
● completed target some_data [0 seconds, 77 bytes]
104-
ended pipeline [0.096 seconds]
99+
+ data_file dispatched
100+
data_file completed [0ms, 26 B]
101+
+ some_data dispatched
102+
some_data completed [1ms, 77 B]
103+
ended pipeline [130ms, 2 completed, 0 skipped]
105104
```
106105

107106
This time we see that `targets` does successfully re-build `some_data` as expected.
@@ -190,13 +189,13 @@ The following objects are masked from ‘package:datasets’:
190189
191190
penguins, penguins_raw
192191
193-
▶ dispatched target penguins_data_raw_file
194-
● completed target penguins_data_raw_file [0.001 seconds, 53.098 kilobytes]
195-
▶ dispatched target penguins_data_raw
196-
● completed target penguins_data_raw [0.097 seconds, 10.4 kilobytes]
197-
▶ dispatched target penguins_data
198-
● completed target penguins_data [0.013 seconds, 1.494 kilobytes]
199-
ended pipeline [0.216 seconds]
192+
+ penguins_data_raw_file dispatched
193+
penguins_data_raw_file completed [1ms, 53.10 kB]
194+
+ penguins_data_raw dispatched
195+
penguins_data_raw completed [220ms, 10.40 kB]
196+
+ penguins_data dispatched
197+
penguins_data completed [14ms, 1.49 kB]
198+
ended pipeline [390ms, 3 completed, 0 skipped]
200199
```
201200

202201
::::::::::::::::::::::::::::::::::
@@ -268,15 +267,15 @@ tar_plan(
268267

269268

270269
``` output
271-
▶ dispatched target hello_file
272-
● completed target hello_file [0 seconds, 26 bytes]
273-
▶ dispatched target hello
274-
● completed target hello [0.001 seconds, 77 bytes]
275-
▶ dispatched target hello_caps
276-
● completed target hello_caps [0.003 seconds, 77 bytes]
277-
▶ dispatched target hello_caps_out
278-
● completed target hello_caps_out [0.001 seconds, 26 bytes]
279-
ended pipeline [0.119 seconds]
270+
+ hello_file dispatched
271+
hello_file completed [1ms, 26 B]
272+
+ hello dispatched
273+
hello completed [0ms, 77 B]
274+
+ hello_caps dispatched
275+
hello_caps completed [0ms, 77 B]
276+
+ hello_caps_out dispatched
277+
hello_caps_out completed [0ms, 26 B]
278+
ended pipeline [171ms, 4 completed, 0 skipped]
280279
```
281280

282281
Take a look at `hello_caps.txt` in the `results` folder and verify it is as you expect.

functions.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -266,10 +266,9 @@ The following objects are masked from ‘package:datasets’:
266266
267267
penguins, penguins_raw
268268
269-
✔ skipping targets (1 so far)...
270-
▶ dispatched target penguins_data
271-
● completed target penguins_data [0.008 seconds, 1.612 kilobytes]
272-
▶ ended pipeline [0.101 seconds]
269+
+ penguins_data dispatched
270+
✔ penguins_data completed [6ms, 1.61 kB]
271+
✔ ended pipeline [98ms, 1 completed, 2 skipped]
273272
```
274273

275274
We will learn more soon about the messages that `targets()` prints out.

lifecycle.md

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@ The following objects are masked from ‘package:datasets’:
5555
5656
penguins, penguins_raw
5757
58-
✔ skipping targets (1 so far)...
59-
✔ skipped pipeline [0.075 seconds]
58+
✔ skipped pipeline [57ms, 3 skipped]
6059
```
6160

6261
Remember how the first time we ran the pipeline, `targets` printed out a list of each target as it was being built?
@@ -113,10 +112,9 @@ The following objects are masked from ‘package:datasets’:
113112
114113
penguins, penguins_raw
115114
116-
✔ skipping targets (1 so far)...
117-
▶ dispatched target penguins_data
118-
● completed target penguins_data [0.022 seconds, 1.494 kilobytes]
119-
▶ ended pipeline [0.124 seconds]
115+
+ penguins_data dispatched
116+
✔ penguins_data completed [19ms, 1.49 kB]
117+
✔ ended pipeline [121ms, 1 completed, 2 skipped]
120118
```
121119

122120
What happened?
@@ -294,8 +292,7 @@ The following objects are masked from ‘package:datasets’:
294292
295293
penguins, penguins_raw
296294
297-
✔ skipping targets (1 so far)...
298-
✔ skipped pipeline [0.081 seconds]
295+
✔ skipped pipeline [73ms, 3 skipped]
299296
```
300297

301298
Let's invalidate `penguins_data` and run it again:
@@ -314,10 +311,9 @@ The following objects are masked from ‘package:datasets’:
314311
315312
penguins, penguins_raw
316313
317-
✔ skipping targets (1 so far)...
318-
▶ dispatched target penguins_data
319-
● completed target penguins_data [0.022 seconds, 1.494 kilobytes]
320-
▶ ended pipeline [0.124 seconds]
314+
+ penguins_data dispatched
315+
✔ penguins_data completed [18ms, 1.49 kB]
316+
✔ ended pipeline [121ms, 1 completed, 2 skipped]
321317
```
322318

323319
If you want to reset **everything** and start fresh, you can use `tar_invalidate(everything())` (`tar_invalidate()` [accepts `tidyselect` expressions](https://docs.ropensci.org/targets/reference/tar_invalidate.html) to specify target names).

md5sum.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@
1919
"learners/reference.md" "3f06251c1f932e767ae8f22db25eb5a2" "site/built/reference.md" "2025-05-06"
2020
"learners/setup.md" "2c9965f182c4d73141cbf0bef2990f16" "site/built/setup.md" "2025-05-06"
2121
"profiles/learner-profiles.md" "44d8b9d8aca7963e6577e8c67d23eac0" "site/built/learner-profiles.md" "2025-05-06"
22-
"renv/profiles/lesson-requirements/renv.lock" "6f04824cc2b957b9ff427dd45da94e9d" "site/built/renv.lock" "2025-05-06"
22+
"renv/profiles/lesson-requirements/renv.lock" "f94a39ea98c936602f9373c1972a231f" "site/built/renv.lock" "2025-05-06"

organization.md

Lines changed: 3 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -145,75 +145,11 @@ tar_plan(
145145
```
146146

147147

148-
``` output
149-
150-
```
151-
152-
``` output
153-
── Debugging ───────────────────────────────────────────────────────────────────
154-
```
155-
156-
``` output
157-
158-
```
159-
160-
``` output
161-
── How to ──────────────────────────────────────────────────────────────────────
162-
```
163-
164-
``` output
165-
166-
```
167-
168-
``` output
169-
── Last error message ──────────────────────────────────────────────────────────
170-
```
171-
172-
``` output
173-
174-
```
175-
176-
``` output
177-
── Last error traceback ────────────────────────────────────────────────────────
178-
```
179-
180148
``` error
181149
Error:
182-
! targets::tar_make() error
183-
• tar_errored()
184-
• tar_meta(fields = any_of("error"), complete_only = TRUE)
185-
• tar_workspace()
186-
• tar_workspaces()
187-
• Debug: https://books.ropensci.org/targets/debugging.html
188-
• Help: https://books.ropensci.org/targets/help.html
189-
duplicated target names: height
190-
base::tryCatch(base::withCallingHandlers({ NULL base::saveRDS(base::do.c...
191-
tryCatchList(expr, classes, parentenv, handlers)
192-
tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), na...
193-
doTryCatch(return(expr), name, parentenv, handler)
194-
tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
195-
tryCatchOne(expr, names, parentenv, handlers[[1L]])
196-
doTryCatch(return(expr), name, parentenv, handler)
197-
base::withCallingHandlers({ NULL base::saveRDS(base::do.call(base::do.ca...
198-
base::saveRDS(base::do.call(base::do.call, base::c(base::readRDS("/tmp/R...
199-
base::do.call(base::do.call, base::c(base::readRDS("/tmp/RtmpOo8uMI/call...
200-
(function (what, args, quote = FALSE, envir = parent.frame()) { if (!is....
201-
(function (targets_function, targets_arguments, options, envir = NULL, s...
202-
tryCatch(out <- withCallingHandlers(targets::tar_callr_inner_try(targets...
203-
tryCatchList(expr, classes, parentenv, handlers)
204-
tryCatchOne(expr, names, parentenv, handlers[[1L]])
205-
doTryCatch(return(expr), name, parentenv, handler)
206-
withCallingHandlers(targets::tar_callr_inner_try(targets_function = targ...
207-
targets::tar_callr_inner_try(targets_function = targets_function, target...
208-
pipeline_from_list(targets)
209-
pipeline_from_list.default(targets)
210-
pipeline_init(out)
211-
pipeline_targets_init(targets, clone_targets)
212-
tar_assert_unique_targets(names)
213-
tar_throw_validate(message)
214-
tar_error(message = paste0(...), class = c("tar_condition_validate", "ta...
215-
rlang::abort(message = message, class = class, call = tar_envir_base)
216-
signal_abort(cnd, .file)
150+
! Error in tar_make():
151+
duplicated target names: height
152+
See https://books.ropensci.org/targets/debugging.html
217153
```
218154

219155
**A major part of working with `targets` pipelines is writing custom functions that are the right size.**

0 commit comments

Comments
 (0)