[R] Problem with write.table

PIKAL Petr petr.pikal at precheza.cz
Mon Mar 18 15:49:39 CET 2013


Hi

> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of Sahana Srinivasan
> Sent: Monday, March 18, 2013 3:04 PM
> To: r-help at r-project.org
> Subject: [R] Problem with write.table
> 
> Hi everyone,
> I'm trying to create unique filenames and then write a data frame into
> these files. This is the code I am using.
> 
> 
> str1<-"fname"
> str2<-".ext.txt";
> FILENAME<-paste0(str1,str2);
> 
> write.table(df,
> file=FILENAME,col.names=FALSE,row.names=FALSE,quote=FALSE,sep="\t");
> 
> 
> 
> Ideally, a file called fname.ext.txt should be created, containing the
> data frame df. However, the file is not getting created at all. Am I
> going wrong somewhere?

Maybe OS and write permissions? I tried your code with some data.frame and I got a file fname.ext.txt without problems.

Check your objecd df and FILENAME.

Regards
Petr

> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at 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.



More information about the R-help mailing list