You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: branch.md
+17-17Lines changed: 17 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -94,8 +94,8 @@ The following objects are masked from ‘package:datasets’:
94
94
penguins, penguins_raw
95
95
96
96
+ combined_model dispatched
97
-
✔ combined_model completed [18ms, 11.20 kB]
98
-
✔ ended pipeline [134ms, 1 completed, 3 skipped]
97
+
✔ combined_model completed [17ms, 11.20 kB]
98
+
✔ ended pipeline [130ms, 1 completed, 3 skipped]
99
99
```
100
100
101
101
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,20 +181,20 @@ The following objects are masked from ‘package:datasets’:
181
181
penguins, penguins_raw
182
182
183
183
+ adelie_model dispatched
184
-
✔ adelie_model completed [8ms, 6.48 kB]
184
+
✔ adelie_model completed [7ms, 6.48 kB]
185
185
+ gentoo_model dispatched
186
-
✔ gentoo_model completed [2ms, 5.88 kB]
186
+
✔ gentoo_model completed [1ms, 5.88 kB]
187
187
+ chinstrap_model dispatched
188
188
✔ chinstrap_model completed [2ms, 4.54 kB]
189
189
+ combined_summary dispatched
190
-
✔ combined_summary completed [6ms, 348 B]
190
+
✔ combined_summary completed [5ms, 348 B]
191
191
+ adelie_summary dispatched
192
192
✔ adelie_summary completed [3ms, 348 B]
193
193
+ gentoo_summary dispatched
194
194
✔ gentoo_summary completed [3ms, 348 B]
195
195
+ chinstrap_summary dispatched
196
-
✔ chinstrap_summary completed [4ms, 348 B]
197
-
✔ ended pipeline [359ms, 7 completed, 4 skipped]
196
+
✔ chinstrap_summary completed [3ms, 348 B]
197
+
✔ ended pipeline [351ms, 7 completed, 4 skipped]
198
198
```
199
199
200
200
Let's look at the summary of one of the models:
@@ -292,12 +292,12 @@ The following objects are masked from ‘package:datasets’:
292
292
penguins, penguins_raw
293
293
294
294
+ combined_summary dispatched
295
-
✔ combined_summary completed [7ms, 348 B]
295
+
✔ combined_summary completed [8ms, 348 B]
296
296
+ penguins_data_grouped dispatched
297
297
✔ penguins_data_grouped completed [6ms, 1.53 kB]
298
298
+ species_summary declared [3 branches]
299
-
✔ species_summary completed [12ms, 1.04 kB]
300
-
✔ ended pipeline [343ms, 5 completed, 3 skipped]
299
+
✔ species_summary completed [11ms, 1.04 kB]
300
+
✔ ended pipeline [313ms, 5 completed, 3 skipped]
301
301
```
302
302
303
303
There is a series of smaller targets (branches) that are each named like species_summary_7fe6634f7c7f6a77, then one overall `species_summary` target.
@@ -406,10 +406,10 @@ The following objects are masked from ‘package:datasets’:
406
406
penguins, penguins_raw
407
407
408
408
+ combined_summary dispatched
409
-
✔ combined_summary completed [22ms, 371 B]
409
+
✔ combined_summary completed [23ms, 371 B]
410
410
+ species_summary declared [3 branches]
411
-
✔ species_summary completed [22ms, 1.11 kB]
412
-
✔ ended pipeline [326ms, 4 completed, 4 skipped]
411
+
✔ species_summary completed [21ms, 1.11 kB]
412
+
✔ ended pipeline [325ms, 4 completed, 4 skipped]
413
413
```
414
414
415
415
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).
@@ -571,16 +571,16 @@ The following objects are masked from ‘package:datasets’:
Copy file name to clipboardExpand all lines: lifecycle.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -55,7 +55,7 @@ The following objects are masked from ‘package:datasets’:
55
55
56
56
penguins, penguins_raw
57
57
58
-
✔ skipped pipeline [68ms, 3 skipped]
58
+
✔ skipped pipeline [67ms, 3 skipped]
59
59
```
60
60
61
61
Remember how the first time we ran the pipeline, `targets` printed out a list of each target as it was being built?
@@ -114,7 +114,7 @@ The following objects are masked from ‘package:datasets’:
114
114
115
115
+ penguins_data dispatched
116
116
✔ penguins_data completed [11ms, 1.50 kB]
117
-
✔ ended pipeline [174ms, 1 completed, 2 skipped]
117
+
✔ ended pipeline [165ms, 1 completed, 2 skipped]
118
118
```
119
119
120
120
What happened?
@@ -313,7 +313,7 @@ The following objects are masked from ‘package:datasets’:
313
313
314
314
+ penguins_data dispatched
315
315
✔ penguins_data completed [11ms, 1.50 kB]
316
-
✔ ended pipeline [175ms, 1 completed, 2 skipped]
316
+
✔ ended pipeline [169ms, 1 completed, 2 skipped]
317
317
```
318
318
319
319
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).
Copy file name to clipboardExpand all lines: packages.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -71,8 +71,8 @@ tar_plan(
71
71
72
72
```output
73
73
+ adelie_data dispatched
74
-
✔ adelie_data completed [18ms, 1.54 kB]
75
-
✔ ended pipeline [125ms, 1 completed, 0 skipped]
74
+
✔ adelie_data completed [20ms, 1.54 kB]
75
+
✔ ended pipeline [121ms, 1 completed, 0 skipped]
76
76
```
77
77
78
78
This method gets around the slow-downs that may sometimes be experienced with Method 1.
@@ -100,8 +100,8 @@ tar_plan(
100
100
101
101
```output
102
102
+ adelie_data dispatched
103
-
✔ adelie_data completed [22ms, 1.54 kB]
104
-
✔ ended pipeline [133ms, 1 completed, 0 skipped]
103
+
✔ adelie_data completed [18ms, 1.54 kB]
104
+
✔ ended pipeline [118ms, 1 completed, 0 skipped]
105
105
```
106
106
107
107
This can be more memory efficient in some cases than loading all packages, since not every target is always made during a typical run of the workflow.
@@ -127,8 +127,8 @@ tar_plan(
127
127
128
128
```output
129
129
+ adelie_data dispatched
130
-
✔ adelie_data completed [9ms, 1.54 kB]
131
-
✔ ended pipeline [118ms, 1 completed, 0 skipped]
130
+
✔ adelie_data completed [7ms, 1.54 kB]
131
+
✔ ended pipeline [109ms, 1 completed, 0 skipped]
132
132
```
133
133
134
134
The benefits of this approach are that the origins of all functions is explicit, so you could browse your code (for example, by looking at its source in GitHub), and immediately know where all the functions come from.
Copy file name to clipboardExpand all lines: parallel.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -214,10 +214,10 @@ The following objects are masked from ‘package:datasets’:
214
214
+ species_predictions declared [3 branches]
215
215
✔ combined_summary completed [4s, 371 B]
216
216
+ combined_predictions dispatched
217
-
✔ species_summary completed [12.8s, 1.11 kB]
217
+
✔ species_summary completed [12.7s, 1.11 kB]
218
218
✔ combined_predictions completed [4s, 25.91 kB]
219
219
✔ species_predictions completed [12s, 27.45 kB]
220
-
✔ ended pipeline [19.1s, 8 completed, 3 skipped]
220
+
✔ ended pipeline [18.9s, 8 completed, 3 skipped]
221
221
```
222
222
223
223
Notice that although the time required to build each individual target is about 4 seconds, the total time to run the entire workflow is less than the sum of the individual target times! That is proof that processes are running in parallel **and saving you time**.
0 commit comments