Hi, R-users,

I have a problem: Because there are few files which can't be readed
into R completely, so on the following subsequence programme, I use
write.table, which creates the "NA" files for those incomplete files
autimatically. 
I don't want those NA files.

My programes formats looks like:



name_c<-Sys.glob("C:/Documents and Settings/lma/My 
Documents/habitdata/*/calllog/*")

for (i in 1:length(name_c)){

log1<-readLines(name_c[i])
....

write.table(Temps, file=paste("C:/Documents and Settings/lma/My 
Documents/habitdata1",pname,lname,basename(name_c[i]),sep="/"))

}


Error Information:
Error in file(file, ifelse(append, "a", "w")) : 
  cannot open the connection

 In file(file, ifelse(append, "a", "w")) :
  cannot open file 'C:/Documents and Settings/lma/My 
Documents/habitdata1/NA/NA/NA': Permission denied


I have checked why the error appears, because  when I use "readLines" to read 
data, but when processing the large data set, there are few files which can not 
be readed in completely:

48: In readLines(name_c[i]) ... :
 
incomplete final line found on 'C:/Documents and Settings/lma/My
Documents/habitdata/244052900243997/calllog/calllog_log-20050505T121611.txt'
...


So it create the "NA" file when implementing the subsequence procedure by 
write.table.How can I do: whenever readLines can't completely read one file, 
then autimatically doesn't implement the subsequence programmes?

Thanks.
Tammy                                     
_________________________________________________________________
More than messagesĀ–check out the rest of the Windows LiveĀ™.
http://www.microsoft.com/windows/windowslive/
        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to