我们正在尝试将一些表数据写入文件,但没有成功。
使用write.csv。
下面是我们尝试的一些示例代码:
> <%
>
> X<-c(1:666)
>
> print(X)
>
> write.csv(X,"hh")
>
> %>以下是我们无法计算出的rapache错误:
RApache Warning/Error!!!
Error in file(file, ifelse(append, "a", "w")) : cannot open the connection
RApache Warning/Error!!!
In addition:
RApache Warning/Error!!!
Warning messages:
RApache Warning/Error!!!
1: In readLines(icon, 1) : incomplete final line found on '/var/www/brew/sampleplan/step1_5.php'
RApache Warning/Error!!!
2: In readLines(icon, 1) : incomplete final line found on '/var/www/brew/sampleplan/step1_5.php'
RApache Warning/Error!!!
3: In readLines(icon, 1) : incomplete final line found on '/var/www/brew/sampleplan/step1_5.php'
RApache Warning/Error!!!
4: In readLines(icon, 1) : incomplete final line found on '/var/www/brew/sampleplan/writefile.php'
RApache Warning/Error!!!
5: In file(file, ifelse(append, "a", "w")) : cannot open file 'hh': Permission denied
RApache Warning/Error!!!函数brew返回了'try-error'对象。返回HTTP响应代码500。
如果有人能给我们写一个简单的例子或者改正我们的代码,那就太棒了。
谢谢你,
Yoni & Tsvi。
发布于 2011-04-16 00:05:48
为了让您的工作更轻松,首先让您的代码自己工作,然后引入rApache。
您看到的错误意味着write.csv无法写入您指定的位置。由于写入文件是常见的问题来源,因此您应该添加一些检查和错误处理代码,以使其更加健壮。例如,
path.expand),或者至少确保您知道当前工作目录的位置(getwd)。file.exists)以及您是否可以写入该目录(使用file.access,在调用try或tryCatch.时使用file.access您对write.csv的调用
https://stackoverflow.com/questions/5678941
复制相似问题