-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
70 lines (59 loc) · 3.37 KB
/
Makefile
File metadata and controls
70 lines (59 loc) · 3.37 KB
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
67
68
69
70
all: prepped_data.Rdata models figures paper
clean:
rm -f *.Rdata;\
rm -f Figures/Figure_2.pdf Figures/Figure_3.pdf Figures/Figure_4.pdf Figures/raneff_violin.pdf \
rm -f Figures/Figure_S1.pdf Figures/Figure_S2.pdf Figures/Figure_S3.pdf Figures/Diagnostic_plots.pdf \
rm -f Fox_model_paper.pdf Fox_model_paper.tex
rm -f SupportingInformation/JAEscroggieST1.pdf SupportingInformation/JAEscroggieST2.pdf
rm -f SupportingInformation/JAEscroggieSF1.pdf SupportingInformation/JAEscroggieSF2.pdf SupportingInformation/JAEscroggieSA1.pdf
#metarule to fit the models
models: Fitted_rain_model.Rdata
#metarule to make the figures
figures: Figures/Figure_2.pdf Figures/Figure_3.pdf Figures/Figure_4.pdf \
Figures/Figure_S1.pdf Figures/Figure_S2.pdf Figures/Figure_S3.pdf Figures/Diagnostic_plots.pdf
#metarule to make the paper
paper: Fox_model_paper.pdf
###############################################################################
#clean and tidy the data, and save to an Rdata file #
###############################################################################
prepped_data.Rdata: Data/spotlight_data.csv Data/AllRain.csv R/prep_data.R
Rscript R/prep_data.R
###############################################################################
#Run the state-space model and save the results #
###############################################################################
Fitted_rain_model.Rdata: R/run_model_rain.R prepped_data.Rdata R/GHR_distlag_rain.txt
Rscript $^ $@
###############################################################################
#generate the figures as pdfs #
###############################################################################
#Figure 2 --posterior densities
Figures/Figure_2.pdf: R/Figure_2.R Fitted_rain_model.Rdata
Rscript $^ $@
#Figure 3 --predicted r for fox populations
Figures/Figure_3.pdf: R/Figure_3.R Fitted_rain_model.Rdata
Rscript $^ $@
#Figure 4 --fox and rabbit abundances
Figures/Figure_4.pdf: R/Figure_4.R Fitted_rain_model.Rdata Data/ripping_data.csv
Rscript $^ $@
###############################################################################
#generate the supplementary figures as pdfs #
###############################################################################
#Figure S1 - rainfall time series
Figures/Figure_S1.pdf: R/Figure_S1.R Data/AllRain.csv
Rscript $^ $@
#Figure S2 - random effects density plots
Figures/Figure_S2.pdf: R/Figure_S2.R Fitted_rain_model.Rdata
Rscript $^ $@
#Figure S3 - Posterior Predictive Checks
Figures/Figure_S3.pdf: R/Figure_S3.R Fitted_rain_model.Rdata
Rscript $^
###############################################################################
#generate the diagnostic plots #
###############################################################################
Figures/Diagnostic_plots.pdf: R/diagnostic_plots.R Fitted_rain_model.Rdata
Rscript $^
###############################################################################
#generate the manuscript as a pdf document #
###############################################################################
Fox_model_paper.pdf: R/render_script.R Fox_model_paper.Rmd rabbit_refs.bib models figures
Rscript R/render_script.R pdf_document