cionysus
# Key variables to define
RDIR = .
MERGE_OUT = MergeData.Rout
# Create list of R source files
RSOURCE = $(wildcard $(RDIR)/*.R)
# Files to indicate when the RSOURCE file was run
OUT_FILES = $(RSOURCE:.R=.Rout)
# Default target
all: $(OUT_FILES)
# Run the RSOURCE files
$(RDIR)/%.Rout: $(RDIR)/%.R
R CMD BATCH $<
# Remove Out Files
clean:
rm -fv $(OUT_FILES)
# Remove MergeData.Rout
cleanMerge:
rm -fv $(MERGE_OUT)
这是《Reproducible Research with R and RStudio Second Edition》第六章的一个作为例子的make文件。
这个make文件的出处在:https://github.com/christophergandrud/Rep-Res-Examples/blob/master/DataGather_Merge/Makefile
我提这个问题是因为,R是我要学习的首要语言,排在其后的是python,而写make文件在很后面(在看此书之前,根本没想过这个make是什么东西),所以我想请教各位,能否将此make文件用python来实现。