I have a long list ("mylist") in R containing sequences of characters that I want to export to a .csv such that each cell contains 1 character:
> str(mylist)
List of 1
$ :List of 259
..$ : chr [1:214] "A" "B" "C" "D" ...
..$ : chr [1:220] "E" "F" "G" "H" ...
When I use write.csv on this, I get an error because the lists contain different numbers of rows. Fine. So I try:
mynewlist<-do.call("cbind", mylist)
write.csv(t(mynewlist), file="mynewlist.csv", quote = FALSE)
but I get
V1 V2 V3 V4 V5
1 c("A" "B" "C" "D" ...
as my output when loaded in excel, which still contains double quotes as well as the "c(" seen in the first cell. Furthermore, though the first row of the CSV should have 214 columns, it wraps back to a new row after 101 cells. The write.csv and write.table functions seem pretty straightforward, as does my data set, so I'm not sure what's going on here. Any thoughts why I can't get a clean CSV export? Thanks!