Re: [R] Hyper-elegant code to get a text file, transpose it, and write it

From: Gabor Csardi <csardi_at_rmki.kfki.hu>
Date: Thu, 05 Jun 2008 14:29:59 +0200

On Thu, Jun 05, 2008 at 10:26:08AM -0200, Alberto Monteiro wrote:
>
>
>
> Uwe Ligges wrote:
> >
> > You probably want
> >
> > write.table(t(read.table(file.in)), file = file.out, row.names =
> > FALSE, col.names = FALSE)
> >
> Ok, almost there. I forgot to tell (because I didn't know)
> that the strings were separated by tabs (I just thought of
> splitting by _any_ space), and that the output would also
> be tab-separated. But there's still a minor feature:
>
> write.table(t(read.table(file.in, sep ="\t")), file = file.out,
> row.names = FALSE, col.names = FALSE, sep = "\t")
>
> writes each output enclosed with quotation marks, like:
>
> "1/2/2003" "0.5638" "0.6233" "0.4559" "0.8746"
>
> I didn't find in the documentation of write.table a way to
> remove those quotes, because qmethod is either escape or double :-(

What about 'quote=FALSE'? Is it not good enough?

G.

> Alberto Monteiro
>
> ______________________________________________
> 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.

-- 
Csardi Gabor <csardi_at_rmki.kfki.hu>    UNIL DGM

______________________________________________
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.
Received on Thu 05 Jun 2008 - 14:17:10 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 05 Jun 2008 - 15:00:37 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive