将RScript的输出分配给makefile变量
我正在尝试使用makefile自动化一些R分析。分析是每月的数据分析和报告。到目前为止,它工作得很好,但为了扩展它,我希望默认操作是创建当前报告,但如果需要,可以指定一个月 我无法将默认报告周期(由R脚本计算)分配给makefile变量 生成文件将RScript的输出分配给makefile变量,r,makefile,R,Makefile,我正在尝试使用makefile自动化一些R分析。分析是每月的数据分析和报告。到目前为止,它工作得很好,但为了扩展它,我希望默认操作是创建当前报告,但如果需要,可以指定一个月 我无法将默认报告周期(由R脚本计算)分配给makefile变量 生成文件 # Assign a data identifier. #IRL could use R to assign current if not specified as an arg to make month := $(Rscript './R
# Assign a data identifier.
#IRL could use R to assign current if not specified as an arg to make
month := $(Rscript './R/reportperiod.R')
test:
echo $(month)
reportperiod.R脚本是
要求(润滑)
但这只是显示
echo
表示脚本值尚未分配给变量。我想您应该使用$(shell…函数初始化月份变量:
month := $(shell $(R_HOME)/bin/Rscript ./R/reportperiod.R)
是的,我们广泛使用该功能进行清洗。
month := $(shell $(R_HOME)/bin/Rscript ./R/reportperiod.R)