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
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
Uwe Ligges wrote:
>
>> Of course this is a trivial task:
>>
>> text.in <- readLines(file.in)
>> matrix.in <- strsplit(text.in, "[ \t]+")
>
> You probably want
>
> write.table(t(read.table(file.in)), file = file.out, row.names =
> FALSE, col.names = FALSE)
>
Unfortunately, it doesn't work. In f
Alberto Monteiro wrote:
Of course this is a trivial task:
text.in <- readLines(file.in)
matrix.in <- strsplit(text.in, "[ \t]+")
You probably want
write.table(t(read.table(file.in)), file = file.out, row.names = FALSE,
col.names = FALSE)
Uwe Ligges
# matrix.out <- transpose matrix.in
Of course this is a trivial task:
text.in <- readLines(file.in)
matrix.in <- strsplit(text.in, "[ \t]+")
# matrix.out <- transpose matrix.in
# loop over the lines of matrix.out creating text.out
writeLines(text.out, file.out)
What is the _most elegant_ way to write the transposition of
matrix.in
5 matches
Mail list logo