-
Notifications
You must be signed in to change notification settings - Fork 0
/
_targets.R
66 lines (60 loc) · 1.91 KB
/
_targets.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
library(targets)
library(tarchetypes)
library(tidyverse)
tar_option_set(
packages = c("tidyverse", "sf")
)
tar_source()
tar_plan(
# Get and format data on 2008-2013 projects ----
budget_reports_text_2008_2013 = read_pre_2014_program_report_text() |>
format_pre_2014_program_report_text(),
project_details_2008_2013 = budget_reports_text_2008_2013 |>
get_pre_2014_project_details(),
project_info_2008_2013 = project_details_2008_2013 |>
get_pre_2014_project_info(),
budget_reports_2008_2013 = project_details_2008_2013 |>
get_pre_2014_project_funding(project_info_2008_2013),
# Get locations for 2014-2024 projects ----
cip_locations_2014_2024_src = read_cip_locations(),
cip_locations_2014_2024 = cip_locations_2014_2024_src |>
format_cip_location_data(),
bureau_xwalk_2014_2024 = build_bureau_xwalk(),
budget_reports_2014_2024_src = read_2014_2024_budget_reports(),
budget_reports_2014_2024 = budget_reports_2014_2024_src |>
format_2014_2024_budget_reports(
budget_data = format_budget_data(budget_reports_2014_2024_src),
bureau_xwalk = bureau_xwalk_2014_2024
),
budget_reports_2014_2024_dict = load_cip_dict(
sheet = "FY14-FY24_CIP-Requests_Source_Dictionary",
file = here::here(
"data",
"FY14-FY24_CIP-Requests_Source_Dictionary.csv"
)
),
location_corrections = googlesheets4::read_sheet(
"https://docs.google.com/spreadsheets/d/16b1AAoZEmcjsrteFNkxNu4gYsIs4MFx__DuMCW9p_hk/edit?usp=sharing"
) |>
filter(!is.na(location_corrected)) |>
select(!n),
budget_reports_2008_2024 = combine_budget_reports(
budget_reports_2008_2013,
budget_reports_2014_2024
) |>
left_join(
location_corrections
) |>
mutate(
location = coalesce(
location_corrected,
location
)
) |>
select(!location_corrected),
# Render README
tar_quarto(
readme_qmd,
path = here::here("README.qmd")
)
)