-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile
52 lines (40 loc) · 2.06 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
## Makefile
## The Out of This World Crew, 12/1/2020
##
## This driver script downloads the data and runs the analysis for our project.
## This script takes no arguments
##
## Example usage:
## make all
all : doc/ufo_report.md
# If we tweak the download script, we need to rerun it
data/raw/aliens.csv : src/download_data.py
python src/download_data.py --location='BC WA' --output_file=data/raw/aliens.csv
# Processed aliens data should depend on the cleaning script
data/processed/aliens.csv : src/times_cleaning.R
Rscript src/times_cleaning.R --fp_raw="data/raw/aliens.csv" --fp_pro="data/processed/aliens.csv"
# The cleaning script should be rerun if we redownload the data or change the cleaning script
src/times_cleaning.R : data/raw/aliens.csv
Rscript src/times_cleaning.R --fp_raw="data/raw/aliens.csv" --fp_pro="data/processed/aliens.csv"
# If we change our EDA script or the data, these figures and tables should be recreated
ufo_duration_distriubution.png summary_shape.rds ufo_duration_summary.rds : src/ufo_eda_bcwa.R
Rscript src/ufo_eda_bcwa.R --input_data='data/processed/aliens.csv' --out_dir='results/'
# If we change our data, we need to update this script
src/ufo_eda_bcwa.R : data/processed/aliens.csv
Rscript src/ufo_eda_bcwa.R --input_data='data/processed/aliens.csv' --out_dir='results/'
# We need to recreate these objects/ images if we tweak the analysis
KW.rds Dunn.rds pairwise_plt.png : src/analysis.R
Rscript src/analysis.R --fp_pro='data/processed/aliens.csv' --fp_results="results/"
# Analysis should depend on the processed data
src/analysis.R : data/processed/aliens.csv
Rscript src/analysis.R --fp_pro='data/processed/aliens.csv' --fp_results="results/"
# We need to regenerate the final report should any of these files be changed
doc/ufo_report.md : KW.rds Dunn.rds pairwise_plt.png summary_shape.rds ufo_duration_summary.rds doc/ufo_refs.bib
Rscript -e "rmarkdown::render('doc/ufo_report.Rmd', output_format = 'all')"
# Cleaning
clean :
rm data/raw/aliens.csv
rm data/processed/aliens.csv
rm -f results/*.png
rm -f results/*.rds
rm doc/*.pdf