Run Markdown Script with make

Created a Makefile to be used to run R markdown scripts. See README for more info. Also created R and html subdirectories. The repo should contain the html subdirectory but not the files in it.
This commit is contained in:
syounkin 2024-10-29 10:39:05 -05:00
parent 9e1ba33097
commit 817126bef5
5 changed files with 68 additions and 9 deletions

15
Makefile Normal file
View file

@ -0,0 +1,15 @@
route_analysis: R/route_analysis.Rmd
R -e 'library("rmarkdown"); old_path <- Sys.getenv("PATH"); Sys.setenv(PATH = paste(old_path, "/usr/local/bin", sep = ":")); rmarkdown::render(knit_root_dir = "~/route_analysis/", output_dir = "~/route_analysis/html", input = "./R/route_analysis.Rmd", output_file = "./html/route_analysis.html")'
clean: clean-data clean-figure clean-script
clean-data:
rm -vf ./R/data/*.rds
clean-script:
rm -rvf ./*.md
clean-figure:
rm -rvf ./figure/
.PHONY: data