0

I have a question regarding this Text particular problem, where the question is answered, but only partially. Namely, getting the output using cat(capture.output(print(my.list), file="test.txt")) works for some elements of the list, but for longer ones does not give a full file, but rather it says [ reached getOption("max.print") -- omitted 299 entries ] and so on. Does anyone know of an alternative to exporting a list in R that does not have a limit in the no. of rows/columns? I tried all of the offered solutions in the example from the link, non of the worked. Important to mention is that I do not want to use unlist or cbind, because the groups within the list are important to stay the way they are.

Thanks!

Braiam
  • 1
  • 11
  • 47
  • 78
Divna Djokic
  • 37
  • 1
  • 6

1 Answers1

1

Divna, try this:

dat = list(a = 1:4, b = 1:8)
setwd("~/../Desktop/")
lapply(1:length(dat), function(x) write.table(t(as.data.frame(dat[x])), 
                                              'test.csv', append= T, sep=',', 
                                              quote = F, col.names = F))
Ventrilocus
  • 1,408
  • 3
  • 13