Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

87 lines
2.4KB

  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 = 24),
  13. # debug = "path_receipts_parquet_8d195f7e",
  14. # cue = tar_cue(mode = "never")
  15. error = "null"
  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_csv, "../data-raw/report_list.csv", format = "file"),
  22. tar_target(path_report_list_raw, prepare_report_list(path_report_list_csv)),
  23. tar_target(report_list_raw, arrow::read_parquet(path_report_list_raw)),
  24. tar_target(
  25. dirs_all,
  26. fs::dir_ls("../data-raw/reports", glob = "**/all", recurse = TRUE, type = "directory")
  27. ),
  28. tar_target(
  29. dirs_receipts,
  30. fs::dir_ls("../data-raw/reports", glob = "**/receipts", recurse = TRUE, type = "directory")
  31. ),
  32. tar_target(
  33. dirs_expenditures,
  34. fs::dir_ls("../data-raw/reports", glob = "**/expenditures", recurse = TRUE, type = "directory")
  35. ),
  36. tar_target(
  37. paths_all_parquet,
  38. write_prepared_report_export(dirs_all, report_list_raw),
  39. pattern = map(dirs_all),
  40. format = "file"
  41. ),
  42. tar_target(
  43. path_receipts_parquet,
  44. write_prepared_receipts_parquet(dirs_receipts, report_list_raw),
  45. pattern = map(dirs_receipts),
  46. format = "file"
  47. ),
  48. tar_target(
  49. path_expenditures_parquet,
  50. write_prepared_expenditures_parquet(dirs_expenditures, report_list_raw),
  51. pattern = map(dirs_expenditures),
  52. format = "file"
  53. ),
  54. tar_target(
  55. cover_raw,
  56. {
  57. paths_all_parquet # depends on prepared report_exports
  58. arrow::open_dataset("../data/cover", partitioning = "sboe_id") |>
  59. dplyr::collect()
  60. }
  61. ),
  62. tar_target(
  63. report_dates,
  64. process_report_dates(report_list_raw, cover_raw)
  65. ),
  66. tar_target(
  67. report_amended_score,
  68. calc_report_amended_score(report_dates)
  69. ),
  70. tar_target(
  71. report_list,
  72. process_report_list(report_list_raw, report_amended_score)
  73. )
  74. )