[R] passing object names in a vector to save?

Wolski wolski at molgen.mpg.de
Fri Feb 20 19:11:41 CET 2004


Thanks a lot!
Its exactly what I was looking for.


*********** REPLY SEPARATOR  ***********

On 2/20/2004 at 12:57 PM Liaw, Andy wrote:

>Is the `list=' argument for save() what you're looking for?
>> Hi!
>> Like to write quite a lot (ca 100) of objects from my 
>> envirovment with save.
>> The names of the objects are in  a list nam.
>> nam<-dir()
>> nam<-grep("E",nam,value=T)
>> length(nam)
>> 20
>> for(x in nam)
>> {
>> 	#reads the objects and assigns the names.
>> 	assign(x,simFromEmboss(Simmatrix(),x))
>> 	nnam<-paste(x,".rda",sep="")
>> 	print(nnam)
>> 	save(x,file=nnam)	
>> }
>> I knew that it fails. (It saves object x containing a char.) 
>> How to save the objects in separate files not typing each 
>> time save(myobj,save="myobj.rda")???
>> Is there a workaround.
>> Sincerely Eryk
>Notice:  This e-mail message, together with any attachments, contains
>information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station, New
>Jersey, USA 08889), and/or its affiliates (which may be known outside the
>United States as Merck Frosst, Merck Sharp & Dohme or MSD and in Japan, as
>Banyu) that may be confidential, proprietary copyrighted and/or legally
>privileged. It is intended solely for the use of the individual or entity
>named on this message.  If you are not the intended recipient, and have
>received this message in error, please notify us immediately by reply
>and then delete it from your system.

Dipl. bio-chem. Eryk Witold Wolski    @    MPI-MG Dep. Vertebrate Genomics   
Ihnestrasse 73 14195 Berlin          'v'    
tel: 0049-30-84131285               /   \    
mail: wolski at molgen.mpg.de        ---W-W----    http://www.molgen.mpg.de/~wolski

More information about the R-help mailing list