|
- # 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 = 12),
- # debug = "path_receipts_parquet_8d195f7e",
- # cue = tar_cue(mode = "never")
- error = "stop"
- )
-
- # 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(path_report_list, "../data-raw/report_list.csv", format = "file"),
- tar_target(report_list, process_report_list(path_report_list)),
-
- tar_target(
- dirs_all,
- fs::dir_ls("../data-raw/reports", glob = "**/all", recurse = TRUE, type = "directory")
- ),
- tar_target(
- dirs_receipts,
- fs::dir_ls("../data-raw/reports", glob = "**/receipts", recurse = TRUE, type = "directory")
- ),
- tar_target(
- dirs_expenditures,
- fs::dir_ls("../data-raw/reports", glob = "**/expenditures", recurse = TRUE, type = "directory")
- ),
-
- tar_target(
- path_receipts_parquet,
- write_receipts_parquet(dirs_receipts, report_list),
- pattern = map(dirs_receipts),
- format = "file"
- ),
-
- tar_target(
- path_expenditures_parquet,
- write_expenditures_parquet(dirs_expenditures, report_list),
- pattern = map(dirs_expenditures),
- format = "file"
- )
- )
|