Skip to content

Commit

Permalink
differences for PR #25
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed May 7, 2024
1 parent 5ccc74d commit 1bcd118
Show file tree
Hide file tree
Showing 11 changed files with 202 additions and 2,102 deletions.
24 changes: 12 additions & 12 deletions basic-targets.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ penguins_csv_file <- path_to_file("penguins_raw.csv")
penguins_csv_file
```

```{.output}
```output
[1] "/home/runner/.local/share/renv/cache/v5/R-4.3/x86_64-pc-linux-gnu/palmerpenguins/0.1.1/6c6861efbc13c1d543749e9c7be4a592/palmerpenguins/extdata/penguins_raw.csv"
```

Expand All @@ -148,7 +148,7 @@ penguins_data_raw
```


```{.output}
```output
Rows: 344 Columns: 17
── Column specification ────────────────────────────────────────────────────────
Delimiter: ","
Expand All @@ -160,7 +160,7 @@ date (1): Date Egg
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
```

```{.output}
```output
# A tibble: 344 × 17
studyName `Sample Number` Species Region Island Stage `Individual ID`
<chr> <dbl> <chr> <chr> <chr> <chr> <chr>
Expand Down Expand Up @@ -207,7 +207,7 @@ penguins_data <- penguins_data_raw |>
penguins_data
```

```{.output}
```output
# A tibble: 342 × 3
species bill_length_mm bill_depth_mm
<chr> <dbl> <dbl>
Expand Down Expand Up @@ -275,14 +275,14 @@ Try running it, and you should see something like this:
tar_make()
```

```{.output}
• start target penguins_csv_file
• built target penguins_csv_file [0.002 seconds]
• start target penguins_data_raw
• built target penguins_data_raw [0.095 seconds]
• start target penguins_data
• built target penguins_data [0.013 seconds]
• end pipeline [0.216 seconds]
```output
▶ dispatched target penguins_csv_file
● completed target penguins_csv_file [0.001 seconds]
▶ dispatched target penguins_data_raw
● completed target penguins_data_raw [0.131 seconds]
▶ dispatched target penguins_data
● completed target penguins_data [0.006 seconds]
▶ ended pipeline [0.283 seconds]
```

Congratulations, you've run your first workflow with `targets`!
Expand Down
112 changes: 56 additions & 56 deletions branch.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@ tar_plan(
```


```{.output}
skip target penguins_data_raw_file
skip target penguins_data_raw
skip target penguins_data
• start target combined_model
• built target combined_model [0.034 seconds]
• end pipeline [0.136 seconds]
```output
skipped target penguins_data_raw_file
skipped target penguins_data_raw
skipped target penguins_data
▶ dispatched target combined_model
● completed target combined_model [0.044 seconds]
▶ ended pipeline [0.163 seconds]
```

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.
Expand All @@ -94,7 +94,7 @@ tar_load(combined_model)
glance(combined_model)
```

```{.output}
```output
# A tibble: 1 × 12
r.squared adj.r.squared sigma statistic p.value df logLik AIC BIC deviance df.residual nobs
<dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <int> <int>
Expand Down Expand Up @@ -146,22 +146,22 @@ tar_plan(
```


```{.output}
skip target penguins_data_raw_file
skip target penguins_data_raw
skip target penguins_data
skip target combined_model
• start target interaction_model
• built target interaction_model [0.004 seconds]
• start target species_model
• built target species_model [0.011 seconds]
• start target combined_summary
• built target combined_summary [0.008 seconds]
• start target interaction_summary
• built target interaction_summary [0.002 seconds]
• start target species_summary
• built target species_summary [0.003 seconds]
• end pipeline [0.144 seconds]
```output
skipped target penguins_data_raw_file
skipped target penguins_data_raw
skipped target penguins_data
skipped target combined_model
▶ dispatched target interaction_model
● completed target interaction_model [0.004 seconds]
▶ dispatched target species_model
● completed target species_model [0.001 seconds]
▶ dispatched target combined_summary
● completed target combined_summary [0.006 seconds]
▶ dispatched target interaction_summary
● completed target interaction_summary [0.003 seconds]
▶ dispatched target species_summary
● completed target species_summary [0.002 seconds]
▶ ended pipeline [0.153 seconds]
```

Let's look at the summary of one of the models:
Expand All @@ -171,7 +171,7 @@ Let's look at the summary of one of the models:
tar_read(species_summary)
```

```{.output}
```output
# A tibble: 1 × 12
r.squared adj.r.squared sigma statistic p.value df logLik AIC BIC deviance df.residual nobs
<dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <int> <int>
Expand Down Expand Up @@ -225,23 +225,23 @@ What is going on here?
First, let's look at the messages provided by `tar_make()`.


```{.output}
skip target penguins_data_raw_file
skip target penguins_data_raw
skip target penguins_data
• start target models
• built target models [0.006 seconds]
• start branch model_summaries_5ad4cec5
• built branch model_summaries_5ad4cec5 [0.008 seconds]
• start branch model_summaries_c73912d5
• built branch model_summaries_c73912d5 [0.002 seconds]
• start branch model_summaries_91696941
• built branch model_summaries_91696941 [0.003 seconds]
• built pattern model_summaries
• end pipeline [0.149 seconds]
```output
skipped target penguins_data_raw_file
skipped target penguins_data_raw
skipped target penguins_data
▶ dispatched target models
● completed target models [0.004 seconds]
▶ dispatched branch model_summaries_812e3af782bee03f
● completed branch model_summaries_812e3af782bee03f [0.006 seconds]
▶ dispatched branch model_summaries_2b8108839427c135
● completed branch model_summaries_2b8108839427c135 [0.003 seconds]
▶ dispatched branch model_summaries_533cd9a636c3e05b
● completed branch model_summaries_533cd9a636c3e05b [0.003 seconds]
● completed pattern model_summaries
▶ ended pipeline [0.15 seconds]
```

There is a series of smaller targets (branches) that are each named like model_summaries_5ad4cec5, then one overall `model_summaries` target.
There is a series of smaller targets (branches) that are each named like model_summaries_812e3af782bee03f, then one overall `model_summaries` target.
That is the result of specifying targets using branching: each of the smaller targets are the "branches" that comprise the overall target.
Since `targets` has no way of knowing ahead of time how many branches there will be or what they represent, it names each one using this series of numbers and letters (the "hash").
`targets` builds each branch one at a time, then combines them into the overall target.
Expand Down Expand Up @@ -292,7 +292,7 @@ tar_read(model_summaries)
```


```{.output}
```output
# A tibble: 3 × 12
r.squared adj.r.squared sigma statistic p.value df logLik AIC BIC deviance df.residual nobs
<dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <int> <int>
Expand Down Expand Up @@ -363,19 +363,19 @@ tar_plan(
```


```{.output}
skip target penguins_data_raw_file
skip target penguins_data_raw
skip target penguins_data
skip target models
• start branch model_summaries_5ad4cec5
• built branch model_summaries_5ad4cec5 [0.03 seconds]
• start branch model_summaries_c73912d5
• built branch model_summaries_c73912d5 [0.006 seconds]
• start branch model_summaries_91696941
• built branch model_summaries_91696941 [0.004 seconds]
• built pattern model_summaries
• end pipeline [0.154 seconds]
```output
skipped target penguins_data_raw_file
skipped target penguins_data_raw
skipped target penguins_data
skipped target models
▶ dispatched branch model_summaries_812e3af782bee03f
● completed branch model_summaries_812e3af782bee03f [0.012 seconds]
▶ dispatched branch model_summaries_2b8108839427c135
● completed branch model_summaries_2b8108839427c135 [0.041 seconds]
▶ dispatched branch model_summaries_533cd9a636c3e05b
● completed branch model_summaries_533cd9a636c3e05b [0.004 seconds]
● completed pattern model_summaries
▶ ended pipeline [0.231 seconds]
```

And this time, when we load the `model_summaries`, we can tell which model corresponds to which row (you may need to scroll to the right to see it).
Expand All @@ -385,7 +385,7 @@ And this time, when we load the `model_summaries`, we can tell which model corre
tar_read(model_summaries)
```

```{.output}
```output
# A tibble: 3 × 13
r.squared adj.r.squared sigma statistic p.value df logLik AIC BIC deviance df.residual nobs model_name
<dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <int> <int> <chr>
Expand All @@ -403,7 +403,7 @@ tar_load(models)
augment(models[[1]])
```

```{.output}
```output
# A tibble: 342 × 8
bill_depth_mm bill_length_mm .fitted .resid .hat .sigma .cooksd .std.resid
<dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
Expand Down
8 changes: 4 additions & 4 deletions cache.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ But, if we just call the name of the object (for example, `penguins_data`), we g
penguins_data
```

```{.error}
```error
Error in eval(expr, envir, enclos): object 'penguins_data' not found
```

Expand Down Expand Up @@ -68,7 +68,7 @@ tar_load(penguins_data)
summary(penguins_data)
```

```{.output}
```output
species bill_length_mm bill_depth_mm
Length:342 Min. :32.10 Min. :13.10
Class :character 1st Qu.:39.23 1st Qu.:15.60
Expand All @@ -92,7 +92,7 @@ Let's try it with `penguins_csv_file`.
tar_read(penguins_csv_file)
```

```{.output}
```output
[1] "/home/runner/.local/share/renv/cache/v5/R-4.3/x86_64-pc-linux-gnu/palmerpenguins/0.1.1/6c6861efbc13c1d543749e9c7be4a592/palmerpenguins/extdata/penguins_raw.csv"
```

Expand All @@ -105,7 +105,7 @@ If you try to run `penguins_csv_file` now, you will get an error:
penguins_csv_file
```

```{.error}
```error
Error in eval(expr, envir, enclos): object 'penguins_csv_file' not found
```

Expand Down
87 changes: 0 additions & 87 deletions config.yaml

This file was deleted.

Loading

0 comments on commit 1bcd118

Please sign in to comment.