R: Print list to a text file

Posted by pms on Stack Overflow See other posts from Stack Overflow or by pms
Published on 2010-06-15T11:47:00Z Indexed on 2010/06/15 12:32 UTC
Read the original article Hit count: 143

Filed under:
|

I have in R a list like this:

> print(head(mylist,2))
[[1]]
[1] 234984  10354  41175 932711 426928

[[2]]
[1] 1693237   13462

Each element of the list has different number of its elements.

I would like to print this list to a text file like this:

mylist.txt
234984  10354  41175 932711 426928
1693237   13462

I know that I can use sink(), but it prints names of elements [[x]], [y] and I want to avoid it. Also because of different number of elements in each element of the list it is not possible to use write() or write.table().

© Stack Overflow or respective owner

Related posts about list

Related posts about r