Skip to content

Commit

Permalink
debug makefile (#9)
Browse files Browse the repository at this point in the history
* debug makefile

replace R CMD BATCH by RScript - RScript stops on error, while R CMD BATCH doesn't throw errors. Bad for students learning whether make works or not.

* Update makefile

changed `RScript` to `Rscript`

Co-authored-by: rgreminger <[email protected]>
  • Loading branch information
hannesdatta and rgreminger authored Mar 7, 2021
1 parent 1ce01ad commit e715be6
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,30 +22,30 @@ gen/paper/output/paper.pdf: gen/paper/output/table1.tex \
# Generate tables
gen/paper/output/table1.tex: gen/analysis/output/model_results.RData \
src/paper/tables.R
R CMD BATCH src/paper/tables.R
Rscript src/paper/tables.R

# Run analysis
gen/analysis/output/model_results.RData: gen/data-preparation/output/data_cleaned.RData \
src/analysis/analyze.R
R CMD BATCH src/analysis/update_input.R
R CMD BATCH src/analysis/analyze.R
Rscript src/analysis/update_input.R
Rscript src/analysis/analyze.R

# Clean data
gen/data-preparation/output/data_cleaned.RData: data/dataset1/dataset1.csv \
data/dataset2/dataset2.csv \
src/data-preparation/merge_data.R \
src/data-preparation/clean_data.R
R CMD BATCH src/data-preparation/update_input.R
R CMD BATCH src/data-preparation/merge_data.R
R CMD BATCH src/data-preparation/clean_data.R
Rscript src/data-preparation/update_input.R
Rscript src/data-preparation/merge_data.R
Rscript src/data-preparation/clean_data.R

# Download data
data/dataset1/dataset1.csv data/dataset2/dataset2.csv: src/data-preparation/download_data.R
R CMD BATCH src/data-preparation/download_data.R
Rscript src/data-preparation/download_data.R

# Clean-up: Deletes temporary files
# Note: Using R to delete files keeps platform-independence.
# --vanilla option prevents from storing .RData output
clean:
R CMD BATCH --vanilla src/clean-up.R
Rscript --vanilla src/clean-up.R

0 comments on commit e715be6

Please sign in to comment.