Skip to content

Commit

Permalink
Fix selected line numbers in readLines()
Browse files Browse the repository at this point in the history
  • Loading branch information
joelnitta committed Feb 4, 2025
1 parent e8bc8e2 commit 195d189
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions episodes/branch.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ Let's see how to write the same plan using **dynamic branching** (after running
```{r}
#| label = "example-model-show-3",
#| eval = FALSE,
#| code = readLines("files/plans/plan_6.R")[2:29]
#| code = readLines("files/plans/plan_6.R")[2:28]
```

What is going on here?
Expand Down Expand Up @@ -327,7 +327,7 @@ Let's combine the cleaning and grouping step into a single command:
```{r}
#| label = "example-model-show-8",
#| eval = FALSE,
#| code = readLines("files/plans/plan_8.R")[2:35]
#| code = readLines("files/plans/plan_8.R")[2:34]
```

And run it once more:
Expand Down
4 changes: 2 additions & 2 deletions episodes/parallel.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ It should now look like this:
```{r}
#| label = "example-model-show-setup",
#| eval = FALSE,
#| code = readLines("files/plans/plan_9.R")[3:42]
#| code = readLines("files/plans/plan_9.R")[3:41]
```

There is still one more thing we need to modify only for the purposes of this demo: if we ran the analysis in parallel now, you wouldn't notice any difference in compute time because the functions are so fast.
Expand All @@ -99,7 +99,7 @@ Then, change the plan to use the "slow" version of the functions:
```{r}
#| label = "example-model-show-9",
#| eval = FALSE,
#| code = readLines("files/plans/plan_10.R")[3:42]
#| code = readLines("files/plans/plan_10.R")[3:41]
```

Finally, run the pipeline with `tar_make()` as normal.
Expand Down
2 changes: 1 addition & 1 deletion episodes/quarto.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ Then, add one more target to the pipeline using the `tar_quarto()` function like
```{r}
#| label = "example-penguins-show-1",
#| eval = FALSE,
#| code = readLines("files/plans/plan_11.R")[2:42]
#| code = readLines("files/plans/plan_11.R")[2:40]
```

```{r}
Expand Down

0 comments on commit 195d189

Please sign in to comment.