generated from hannesdatta/template-team-project
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmakefile
56 lines (47 loc) · 1.82 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
# Welcome, this will take a while. Get a coffee, you deserve it.
# Please ensure you are logged in on your VPN if you have one. Otherwise tbe downloading of the data may fail.
# Define objects to improve efficieny
# = src/data_generation/getting_the_data.R
data_download = src/data_generation/getting_the_data.R
data_merging = src/data_prep/merging_the_data.R
data_cleaning = src/data_prep/data_prep.Rmd
data_analysis = src/analysis/regression_analysis.Rmd
paper = gen/paper/paper.Rmd
# Define targets and dependencies
Debug: gen/paper/paper.pdf
# All:
#Input
# Target to download data
data/movie_data.RData: $(data_download)
R --vanilla < $(data_download)
# Transformation
# Target to merge data
data/movie_data.csv: $(data_merging) data/movie_data.RData
R --vanilla < $(data_merging)
# Target to clean data, and safe graph data
data/movie_data_cleaned.csv: $(data_cleaning) data/movie_data.csv
Rscript -e "rmarkdown::render('$<')"
# Target to analyse data, and safe graph data
data/graph_data.csv: $(data_analysis) data/movie_data_cleaned.csv
Rscript -e "rmarkdown::render('$<')"
#Output
# Target to safe the pdf of the paper
gen/paper/paper.pdf: $(paper) data/graph_data.csv
Rscript -e "rmarkdown::render('$<')"
# Target to run the shiny web application, if you are done using the shiny web application manually stop the make and type "clear" to clean up the terminal
app: data/graph_data.csv app.R
R --vanilla <app.R
#cleaning up after outselves
clean:
R -e "unlink('.Rhistory')"
R -e "unlink('*.RData')"
R -e "unlink('data/*.RData')"
R -e "unlink('*.csv')"
R -e "unlink('data/*.csv')"
R -e "unlink('*.pdf')"
R -e "unlink('gen/data_analysis/*.pdf')"
R -e "unlink('gen/data_preparation/*.pdf')"
R -e "unlink('gen/paper/*.pdf')"
R -e "unlink('*.png')"
R -e "unlink('gen/data_analysis/*.png')"
R -e "unlink('gen/data_preparation/*.png')"