Skip to content
Prev 294632 / 398502 Next

Transfering data from R list to other document format

On May 15, 2012, at 6:56 AM, pannigh wrote:

            
Two reasons:
The glaringly obvious error is that you have constructed 'list1' and  
then called lapply with an argument of 'L1'.
The more difficult error to see is that 'write' will not accept a list  
of lists, which is what your fourth element. Using a recursive apply  
function can help. Try either on  of these:

 > rapply(list1, function(x) { cat(c(x, "\n"), file="test.txt",  
append=TRUE) })
NULL

 > rapply(list1, function(x) { write(x, file="test.txt", append=TRUE) })
NULL