|
- # Created by use_targets().
- # Follow the comments below to fill in this target script.
- # Then follow the manual to check and run the pipeline:
- # https://books.ropensci.org/targets/walkthrough.html#inspect-the-pipeline
-
- # Load packages required to define the pipeline:
- library(targets)
-
- # Set target options:
- tar_option_set(
- packages = strsplit(desc::desc_get_field("Depends"), ", ")[[1]],
- # For distributed computing in tar_make(), supply a {crew} controller
- # as discussed at https://books.ropensci.org/targets/crew.html.
- controller = crew::crew_controller_local(workers = 2)
- )
-
- # Run the R scripts in the R/ folder with your custom functions:
- tar_source()
-
- # Replace the target list below with your own:
- list(
- tar_target(year, 2016:2023),
- tar_target(report, c("MY", "YE", "Q1", "Q2", "Q3", "Q4")),
- tar_target(
- doc_list,
- get_report_by_year_export(year, report),
- pattern = cross(year, report)
- ),
- tar_target(
- committees,
- doc_list |>
- # this is the list of committees and years reported
- # if `n_reports` changes, we have to go re-read that year
- count(committee_name, sboe_id, year, name = "n_reports") |>
- arrange(sboe_id)
- )
- )
|