I have a list of words, which I want to output to a text file. For example:
words <- c("a", "and", "book", "cat", "car", "door", "donkey", "ogre", "princess", "rain")
write(words, file = "test.out", ncolumns = 5, sep = "\t")
This works, but it gives me the words in order horizontally: a, and, book, cat, car in the first row, then door, donkey, ogre, princess, rain in the second row. I want the order to go down columns. (Obviously, the actual list is much longer than this example).
Any way to do that?
Thanks.