下面是一个例子:如何捕获系统2()输出中的R
RR<-"/usr/bin/R"
x<-system2(RR, "--version")
R version 3.3.3 (2017-03-06) -- "Another Canoe"
Copyright (C) 2017 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under the terms of the
GNU General Public License versions 2 or 3.
For more information about these matters see
http://www.gnu.org/licenses/.
> x
[1] 0
正如你可以在这里看到的x is 0
。我的问题是如何将'system2(RR,“--version”)'输出分配给x
。
大,对你的帮助谢谢! –
我做的差不多相同[这里](https://stackoverflow.com/questions/45426902/system2-to-call-python2-and-python3-inside-r)但我没有得到预期的输出,想法? – hhh