将终端中的变量集导出到R

时间:2018-10-30 01:41:37

标签: r terminal echo

我正在使用RStudio运行Mac OS High Sierra。

我想将终端设置变量导出到RStudio,但是echo和getenv当前未显示任何输出:

在终端机中:

export testexpvar="testworks"

###I can echo in the terminal
echo $testexpvar
testworks

在RStudio控制台中:

###I can't echo in R:
system("echo $testexpvar") ### no output at all

Sys.getenv("testexpvar")
[1] ""

0 个答案:

没有答案
相关问题