Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

55 lines
1.7KB

  1. # Created by use_targets().
  2. # Follow the comments below to fill in this target script.
  3. # Then follow the manual to check and run the pipeline:
  4. # https://books.ropensci.org/targets/walkthrough.html#inspect-the-pipeline
  5. # Load packages required to define the pipeline:
  6. library(targets)
  7. # Set target options:
  8. tar_option_set(
  9. packages = strsplit(desc::desc_get_field("Depends"), ", ")[[1]],
  10. # For distributed computing in tar_make(), supply a {crew} controller
  11. # as discussed at https://books.ropensci.org/targets/crew.html.
  12. controller = crew::crew_controller_local(workers = 12),
  13. # debug = "path_receipts_parquet_8d195f7e",
  14. # cue = tar_cue(mode = "never")
  15. error = "stop"
  16. )
  17. # Run the R scripts in the R/ folder with your custom functions:
  18. tar_source()
  19. # Replace the target list below with your own:
  20. list(
  21. tar_target(path_report_list, "../data-raw/report_list.csv", format = "file"),
  22. tar_target(report_list, process_report_list(path_report_list)),
  23. tar_target(
  24. dirs_all,
  25. fs::dir_ls("../data-raw/reports", glob = "**/all", recurse = TRUE, type = "directory")
  26. ),
  27. tar_target(
  28. dirs_receipts,
  29. fs::dir_ls("../data-raw/reports", glob = "**/receipts", recurse = TRUE, type = "directory")
  30. ),
  31. tar_target(
  32. dirs_expenditures,
  33. fs::dir_ls("../data-raw/reports", glob = "**/expenditures", recurse = TRUE, type = "directory")
  34. ),
  35. tar_target(
  36. path_receipts_parquet,
  37. write_receipts_parquet(dirs_receipts, report_list),
  38. pattern = map(dirs_receipts),
  39. format = "file"
  40. ),
  41. tar_target(
  42. path_expenditures_parquet,
  43. write_expenditures_parquet(dirs_expenditures, report_list),
  44. pattern = map(dirs_expenditures),
  45. format = "file"
  46. )
  47. )