-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
65 lines (47 loc) · 1.99 KB
/
Makefile
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
YR := 2022
CWS_YR := 2021
RUN_THAT = Rscript $< $(YR) $(CWS_YR)
RUN_THIS = Rscript $@ $(YR) $(CWS_YR)
KNIT = Rscript -e "rmarkdown::render('$<', output_format = rmarkdown::github_document(html_preview = FALSE))"
.PHONY: testvars
testvars:
Rscript utils/pkgs_utils.R $(YR) $(CWS_YR)
.PHONY: all
all: README.md distro output_data/acs_town_basic_profile_$(YR).rds
.PHONY: distro
distro: output_data/acs_nhoods_by_city_$(YR).rds website/5year$(YR)town_profile_expanded_CWS.csv
#### METADATA ----
# writes website_meta, downloads reg_puma_list
utils/$(YR)_website_meta.rds utils/reg_puma_list.rds &: scripts/00_make_meta.R
$(RUN_THAT)
README.md: README.Rmd
$(KNIT)
#### OUTPUT ----
fetch_data/acs_basic_$(YR)_fetch_all.rds: scripts/01_fetch_acs_data.R
$(RUN_THAT)
output_data/cws_basic_indicators_$(CWS_YR).rds: scripts/02_calc_cws_data.R
$(RUN_THAT)
output_data/acs_town_basic_profile_$(YR).rds output_data/acs_town_basic_profile_$(YR).csv to_distro/town_acs_basic_distro_$(YR).csv &: scripts/03_calc_acs_towns.R
$(RUN_THAT)
output_data/acs_nhoods_by_city_$(YR).rds $(wildcard to_distro/*_acs_basic_neighborhood_$(YR).csv) &: scripts/04_calc_acs_nhoods.R
$(RUN_THAT)
website/5year$(YR)town_profile_expanded_CWS.csv: scripts/05_assemble_for_distro.R
$(RUN_THAT)
#### SCRIPTS ----
scripts/*.R: utils/pkgs_utils.R
scripts/01_fetch_acs_data.R: utils/reg_puma_list.rds
scripts/03_calc_acs_towns.R: fetch_data/acs_basic_$(YR)_fetch_all.rds utils/indicator_headings.txt
scripts/04_calc_acs_nhoods.R: fetch_data/acs_basic_$(YR)_fetch_all.rds utils/indicator_headings.txt
scripts/05_assemble_for_distro.R: utils/$(YR)_website_meta.rds \
output_data/acs_town_basic_profile_$(YR).rds \
output_data/cws_basic_indicators_$(CWS_YR).rds \
utils/indicator_headings.txt
#### RELEASE ----
.PHONY: release
release: utils/upload_gh_release.sh
utils/upload_gh_release.sh: output_data/acs_town_basic_profile_$(YR).rds
bash $@
#### CLEANUP ----
.PHONY: clean
clean:
rm -f output_data/* to_distro/* fetch_data/* website/* utils/*.rds