Skip to content

exporting simulated data

3 messages · Ray Cheung, Jessica Streicher, Rui Barradas

#
Rather unspecific.

Basically you'd need a loop to create the sets, and a way to write them into a file. 

You did not specify the format of your data. You might be able to use write, write.table or write.csv and the like.
You could also have a look at ?save which allows you to save any R object.

You also did not specify how important that filename format is. For example:

for(i in 1:5){
	#create data
	someData <- i
	#create filename
	filename<-paste("data",i,".dat",sep="")
	#save data
	write(someData,filename)
}

This would make unique filenames but not quite what you wanted.

greetings,
Jessi
On 17.01.2013, at 04:31, Ray Cheung wrote:

            
#
Hello,
Em 17-01-2013 11:56, Jessica Streicher escreveu:
For this maybe

filename <- sprintf("data%04d.dat", i)


Hope this helps,

Rui Barradas