返回R中成功或失败的write.table的代码

时间:2016-03-18 00:05:29

标签: r csv

问题:有没有办法可以返回成功或失败write.table来电的结果?这就是我试过的:

> x <- write.table(mydata, file="AllDat.csv", sep=",", row.names = FALSE, col.names=TRUE, append=FALSE

Error in file(file, ifelse(append, "a", "w")) :cannot open the connection
In addition: Warning message: In file(file, ifelse(append, "a", "w")) : cannot open file 'AllDat.csv': Permission denied

> x
NULL

即使成功write.table,变量x仍为NULL。

0 个答案:

没有答案