使用commandArgs将参数传递给r文件在Shiny应用程序中不起作用

时间:2017-05-05 16:05:49

标签: r shiny

以下正确打印" hello world":

main_script.R

commandArgs <- function() "hello world"
source('file_to_source.R')

file_to_source.R

word<-(commandArgs())
print(word)

但是,如果main_script.R中的代码是从Shiny应用程序中运行的,则file_to_source.R将打印:

[1]&#34; RStudio&#34; &#34; - 交互式&#34;

有解决方法吗?我真的希望能够从闪亮的内部将变量传递给另一个脚本。

0 个答案:

没有答案