[R] *** saving files ***

TEMPL Matthias Matthias.Templ at statistik.gv.at
Wed Sep 14 16:04:23 CEST 2005


Hi,

write.table(result, paste("path/file_",i,sep=""))

inside the for-loop should done this in a for( i in ... ) loop.

Or:
save(result, file=paste("path/file_",i,sep="")

See ?read.table and ?load for loading the files.

Best,
Matthias

> 
>    Hi,
> 
>    
> 
>    I need help  :o(
> 
>    
> 
>    I want that my function saves result files in a for()-loop 
> while it runs
>    automatically.
> 
>    
> 
>    the filenames must be saved like:
> 
>    
> 
>    file_1  -> for 1. result
> 
>    file_2  -> for 2. result
> 
>    file_3  -> for 3. result
> 
>    
> 
>    and
> 
>    .
> 
>    .
> 
>    .  
> 
>    
> 
>    file_n -> for n. result
> 
>    
> 
>    the file names are the same identified by _1, _2 , _3, ... , _n
> 
>    
> 
>    these files will loaded by a second function later in the 
> same sequence
>    (_1 to _n). 
> 
>    
> 
>    how can I do that ...
> 
>    
> 
>    
> 
>     
> 
>    
> 
>    
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list 
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read 
> the posting guide! http://www.R-project.org/posting-guide.html
>




More information about the R-help mailing list