全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 R语言论坛
944 1
2016-11-30
问题:批处理方式调用“.r”文件时,其中的write.table()函数失效

批处理文件---”auto.bat“如下:
cd D:\R\R-3.3.1\bin
Rscript E:\Rproject\arith.r 2 3.14159


R文件---“arith.R”如下:
argv <- commandArgs(TRUE)
x <- as.numeric(argv[1])
y <- as.numeric(argv[2])
tmp<-c(x+y,x-y,x,y)
tmp<-c(1,2,3,4,6)
cat(tmp)
write.table(tmp, file = "asdasdasdasdasd.txt",col.names = F,row.names = F,sep = "     " )
cat("x / y = ", x / y, "\n")
cat(tmp)


CMD方式运行结果如下:
QQ图片20161130102954.png

问题描述:“write.table(tmp, file = "asdasdasdasdasd.txt",col.names = F,row.names = F,sep = "     " )”没用了????????为什么?????

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2016-11-30 10:33:22
补充一下:“E:\Rproject”目录下没有那个“asdasdasdasdasd.txt”文件出现
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群