[R] Puzzled by write.table function

Wang, Hui Hui_Wang at affymetrix.com
Fri Feb 13 08:35:18 CET 2004


Hi,
Sorry,the syntax in the email was wrong. 


The code is boring, it virtually processes some data and write the results
out using write.table function at the end. The output has <10,000 rows.

Here is part of the code:

....

write.table(sigGene, file="sigGene1.tab",append=FALSE, quote = FALSE, sep
="\t", eol = "\n", na = "NA", dec = ".", row.names =FALSE, col.names=FALSE);

write.table(cbind(gene,geneScored), file="sigGene_scored.tab",append=FALSE,
quote = FALSE, sep="\t", eol = "\n", na = "NA", dec = ".", row.names
=FALSE,col.names=FALSE);

sigGene is a matrix of 2 cols, gene, geneScored  are vectors generated by
early code.


I used the linux version 1.7.1.


Thanks

-h

-----Original Message-----
From: Uwe Ligges [mailto:ligges at statistik.uni-dortmund.de] 
Sent: Thursday, February 12, 2004 11:29 PM
To: Wang, Hui
Cc: R-help
Subject: Re: [R] Puzzled by write.table function


Wang, Hui wrote:
> I am puzzled by the following:
> 
> I use two write.table function(write into files)  in my code  as 
> following (I use  source to call the code): ....
> write.table (x1, file ="x1.txt", quote = "FALSE", append=FALSE, sep="\t",
> eol="\n", "na=NA"...)
> ....(more statement)
> ..
> write.table (x2, file="x2.txt"...)
> 
> 
>  it turned out the second one is always empty.
> 
> I know there is nothing the code itself as I can get second 
> write.table statement work if I comment the first.
> 
> Does anybody know what happened here?

No, in particular not in this case, because you have given a 
non-reproducible example (moreover, it is syntactically wrong!).

Please also tell us your version of R and your OS.

Uwe Ligges




More information about the R-help mailing list