[R] write text file as output without quotes

Thomas Liebig thomas.liebig at iais.fraunhofer.de
Tue Apr 7 15:25:45 CEST 2009


Hi,

you shouldn't call your variable try, see ?try for help on this function.

write.table has a paramter called quotes. just set this to FALSE to 
produce your wanted output:

t=data.frame(rep("a",5), rep("b",5))
write.table(t,"z:\\try.txt",row.names=F,col.names=F,sep="\t", quotes=FALSE)

regards,
Thomas Liebig


Ravi S. Shankar schrieb:
> Hi R,
> 
>  
> 
> When I use the below to write the text file
> 
> try=data.frame(rep("a",5), rep("b",5))
> 
> write.table(try,"z:\\try.txt",row.names=F,col.names=F,sep="\t")
> 
>  
> 
> the output contains two columns with quotes! Is there a way to write
> without quotes?
> 
> I tried 
> 
> try[,1]=noquote(try[,1])
> 
> try[,2]=noquote(try[,2]) 
> 
>  
> 
> Thank you,
> 
> Regards,
> 
> Ravi Shankar


-- 
Thomas Liebig
Fraunhofer-Institut für Intelligente Analyse- und
Informationssysteme (IAIS)

Schloss Birlinghoven, D-53754 Sankt Augustin, Germany
Email:  thomas.liebig at iais.fraunhofer.de
Phone:  +49 2241 142050
Fax:    +49 2241 142072




More information about the R-help mailing list