From 195d1895e592b660a4610c7d06b1bd3b58d83b50 Mon Sep 17 00:00:00 2001 From: joelnitta Date: Tue, 4 Feb 2025 17:33:00 +0900 Subject: [PATCH] Fix selected line numbers in readLines() --- episodes/branch.Rmd | 4 ++-- episodes/parallel.Rmd | 4 ++-- episodes/quarto.Rmd | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/episodes/branch.Rmd b/episodes/branch.Rmd index 9ec33475..03107424 100644 --- a/episodes/branch.Rmd +++ b/episodes/branch.Rmd @@ -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? @@ -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: diff --git a/episodes/parallel.Rmd b/episodes/parallel.Rmd index 1fa7c573..59085733 100644 --- a/episodes/parallel.Rmd +++ b/episodes/parallel.Rmd @@ -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. @@ -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. diff --git a/episodes/quarto.Rmd b/episodes/quarto.Rmd index 4f095276..130f471e 100644 --- a/episodes/quarto.Rmd +++ b/episodes/quarto.Rmd @@ -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}