[R] write.table() error

Charilaos Skiadas cskiadas at gmail.com
Fri Jun 6 06:09:22 CEST 2008


I just managed to write things just fine, and then I recalled that I  
had a similar problem when teaching our students SPSS (Yes, I know,  
don't ask...), but the problem was effectively this: If a given file  
was open in Excel, then that file was locked and no other program  
could use it until you close the file in Excel. So is perhaps a file  
called data1.csv already in existence and open in Excel when you try  
this?

Haris Skiadas
Department of Mathematics and Computer Science
Hanover College

On Jun 5, 2008, at 11:57 PM, Megh Dal wrote:

> Hi,
>
> I got following error in write.table() :
>
>> write.table(dataa, file="c:/data1.csv", row.names=F, col.names=T,  
>> sep=",")
> 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 'c:/data1.csv': Permission denied
>
>
> where dataa is a zoo object
>> head(dataa)
>          data11 data22
> Nov 1980 988.25 194841
> Dec 1980 942.38 205732
> Jan 1981 935.90 226501
> Feb 1981 968.79 227402
> Mar 1981 932.77 233490
> Apr 1981 906.18 233447
>
>
> Can please tell me why this error is coming? I am using Windows vista
>



More information about the R-help mailing list