Best Answer · By JanBask Data Science Expert
Answered on Dec 2, 2019
print(head(mylist,2))
[[1]]
[1] 2349 103 411 9321 4268
[[2]]
[1] 16937 162
For printing all the elements of a list given to a text file, we can perform lapply() function to pass into a list and append into a text file as an output such as
lapply(mylist, write, "outputfile.txt",append=TRUE, ncolumns=1000)