Skip to content

Commit

Permalink
Fix _results.yml variables
Browse files Browse the repository at this point in the history
  • Loading branch information
danielvartan committed Dec 12, 2024
1 parent 2735610 commit 1c6a438
Show file tree
Hide file tree
Showing 14 changed files with 87 additions and 2,384 deletions.
2 changes: 1 addition & 1 deletion R/_pre-render-begin.R
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ for (i in var_files){

env_vars |> yaml::write_yaml(env_vars_file_path)

# Create result variables -----
# Create `_results.yml` variables -----

source(here::here("R", "_pre-render-vars.R"))

Expand Down
13 changes: 9 additions & 4 deletions R/_pre-render-vars.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,15 @@ raw_data <- targets::tar_read(
store = here::here("_targets")
)

weighted_data <- targets::tar_read(
"weighted_data",
store = here::here("_targets")
)

# Chapter 6 -----

analysis_data_per_nrow_2017_10_15 <- weighted_data |>
analysis_sample_per_nrow_2017_10_15 <-
weighted_data |>
dplyr::filter(lubridate::date(timestamp) == as.Date("2017-10-15")) |>
nrow() |>
magrittr::divide_by(weighted_data |> nrow()) |>
Expand Down Expand Up @@ -45,15 +51,14 @@ analysis_data_per_nrow_2017_10_15 <- weighted_data |>
write_in_results_yml(
list(
pr_raw_data_nrow = raw_data |> nrow(),
pr_analysis_sample_per_nrow_2017_10_15 = analysis_data_per_nrow_2017_10_15
pr_analysis_sample_per_nrow_2017_10_15 = analysis_sample_per_nrow_2017_10_15
)
)

rm(
raw_data,
anonymized_data,
weighted_data,
pr_analysis_data_per_nrow_2017_10_15
analysis_data_per_nrow_2017_10_15
)

results_vars <- yaml::read_yaml(here::here("_results.yml"))
27 changes: 12 additions & 15 deletions _quarto-html.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,17 @@ book:
- qmd/chapter-5.qmd
- qmd/chapter-6.qmd
- qmd/references.qmd
# appendices:
# - qmd/supplementary-material-1.qmd
# - qmd/supplementary-material-2.qmd
# - qmd/supplementary-material-3.qmd
# - qmd/supplementary-material-4.qmd
# - qmd/supplementary-material-5.qmd
# - qmd/supplementary-material-6.qmd
# - qmd/supplementary-material-7.qmd
# - qmd/supplementary-material-8.qmd
# - qmd/supplementary-material-9.qmd
# - qmd/supplementary-material-10.qmd
appendices:
- qmd/supplementary-material-1.qmd
- qmd/supplementary-material-2.qmd
- qmd/supplementary-material-3.qmd
- qmd/supplementary-material-4.qmd
- qmd/supplementary-material-5.qmd
- qmd/supplementary-material-6.qmd
- qmd/supplementary-material-7.qmd
- qmd/supplementary-material-8.qmd
- qmd/supplementary-material-9.qmd
- qmd/supplementary-material-10.qmd
comments:
hypothesis:
theme: clean
Expand Down Expand Up @@ -73,7 +73,4 @@ format:
repo-actions: true
link-external-icon: false
link-external-newwindow: false
theme:
- cosmo
- scss/web.scss
- brand
theme: [cosmo, brand, scss/web.scss]
Loading

0 comments on commit 1c6a438

Please sign in to comment.