Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
example of a makefile that runs an r job and sends an email when done.
EMAIL=youremail@gmail.com
SERVER=username@yourserver.com
mode=standard # e.g., quick, standard, publication
all:
make models mode=$(mode)
make ppc mode=$(mode)
make standard-figures mode=$(mode)
make yhat mode=$(mode)
models:
Rscript -e "library(knitr); analysis_mode = '$(mode)'; knit('reports/bayesian-models.rmd')"
echo "Models on $(mode) is complete." | mail -s "Models on $(mode) is complete." $(EMAIL)
ppc:
Rscript -e "library(knitr); analysis_mode = '$(mode)'; knit('reports/bayesian-ppc.rmd')"
echo "ppc on $(mode) is complete." | mail -s "ppc on $(mode) is complete." $(EMAIL)
figures:
Rscript -e "library(knitr); analysis_mode = '$(mode)'; knit('reports/bayesian-figures.rmd')"
echo "standard-figures on $(mode) is complete." | mail -s "standard-figures on $(mode) is complete." $(EMAIL)
yhat:
Rscript -e "library(knitr); analysis_mode = '$(mode)'; knit('reports/mu_y.rmd')"
echo "yhat on $(mode) is complete." | mail -s "yhat on $(mode) is complete." $(EMAIL)
updatelocal:
rsync -av --update $(SERVER):~/dynamic-pwi-analysis/ .
updateserver:
rsync -av --update . $(SERVER):~/dynamic-pwi-analysis/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.