2
以下是.r
文件中的代码。我想从Windows命令提示符执行此操作,但是如何执行?如何在windows中执行.r文件
library(coda)
a <- read.coda("CODAchain1.txt","CODAindex.txt")
out <- capture.output(summary(a))
cat(out,file="out.txt",sep="\n",append=FALSE)
以下是.r
文件中的代码。我想从Windows命令提示符执行此操作,但是如何执行?如何在windows中执行.r文件
library(coda)
a <- read.coda("CODAchain1.txt","CODAindex.txt")
out <- capture.output(summary(a))
cat(out,file="out.txt",sep="\n",append=FALSE)
您可以命名coda_scrp.r
,然后在命令提示符下键入的文本文件:
R CMD BATCH /<full-path>/coda_scrp.r
吉姆柠檬是一个将R大师的,关于R-帮助作出贡献。他做了很多基本图形的图形工作,并且是plotrix软件包的主要贡献者。他也有一个网站,“kickstart系统R”,你可以得到更多的details about running R scripts here:
下面是一个well written set of instructions一个链接显示,使用R CMD批处理和RSCRIPT的差异:
这里是SO答案显示如何使用.bat文件:Start RScript without DOS box (on Windows)?
为什么不'Rscript'? – 2011-05-16 13:08:39
没理由。你可能会写一个更好的答案。我只是写了这个,因为第一个答案是错误的。 – 2011-05-16 13:09:28