R CMD BATCH-端子输出 [英] R CMD BATCH - output in terminal
本文介绍了R CMD BATCH-端子输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
仅学习R,我认为在unix终端中以批处理模式使用它而不是在R终端中编写将是很棒的.
Just learning R and I thought it would be great to use it in batch mode in the unix terminal instead of writing in the R terminal.
所以我决定写test.r
So I decided to write test.r
x <- 2
print(x)
那我在航站楼里
R CMD BATCH test.r
它运行,但是输出一个test.r.Rout文件.通过运行R CMD BATCH test.r out.txt,可以将其输出为文本文件.
it runs, But outputs a test.r.Rout file. I can get it to output to say a text file by running R CMD BATCH test.r out.txt.
问题是,可以将输出打印到终端吗?
Question is, is it possible to print the output to the terminal?
推荐答案
Sebastian-C发布:
Sebastian-C posted:
Rscript test.r
这在终端中起作用并产生了所需的输出
This worked in the terminal and produced the desired output
感谢Sebastian-C
Thanks Sebastian-C
这篇关于R CMD BATCH-端子输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文