Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-cloud-platform/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
将RScript的输出分配给makefile变量_R_Makefile - Fatal编程技术网

将RScript的输出分配给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

我正在尝试使用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/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)