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

From: Alberto Monteiro <>
Date: Thu, 05 Jun 2008 10:07:03 -0200

Uwe Ligges wrote:
>> Of course this is a trivial task:
>> <- readLines(
>> <- strsplit(, "[ \t]+")
> You probably want
> write.table(t(read.table(, file = file.out, row.names =
> FALSE, col.names = FALSE)
Unfortunately, it doesn't work. In fact, read.table( returns an error:

Erro em scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, :   linha 1 não tinha 1362 elementos

which means
  line 1 does not have 1362 elements

(whatever that means!)

Alberto Monteiro mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Thu 05 Jun 2008 - 14:04:03 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 Please read the posting guide before posting to the list.

list of date sections of archive