[R] Creating several txt outputs

Domenico Vistocco vistocco at unicas.it
Wed Feb 18 21:41:56 CET 2009

diego Diego wrote:
> Dear R experts:
>  I have a list (a very long one) and I need to create successively txt
> outputs (on diferent files ideally) for the data of each component of the
> list.
> How can I do this?
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))


you can specify the full path of the file (else you are writing in the 
current directory)
> Thanks in advance!!
> 	[[alternative HTML version deleted]]
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

More information about the R-help mailing list