Skip to content

Creating several txt outputs

2 messages · diego Diego, Domenico Vistocco

#
diego Diego wrote:
Maybe this could help you:

list2Files <- list(1:3, letters[1:10], matrix(1:15, 5, 3))
mapply(function(x, idFile){write(x, paste("file", idFile, ".txt", 
sep=""))}, list2Files, 1:length(list2FIles))

Ciao,
domenico

PS:
you can specify the full path of the file (else you are writing in the 
current directory)