  Hi!

assign() should do the job.
But using a list, and filling each element iteratively (with a for loop 
or with *apply() ) might be better, up to you.

Btw, why do you remove your objects?

HTH,
Ivan

Le 9/16/2010 17:44, Maas James Dr (MED) a écrit :
> Simple one here ... but can't get it to work ...
>
> for (i in 1:4){
>      paste("stuff",[i]),sep="")<- 3 + i
> }
>
> ls()
> rm(list=ls())
>
>
>
> I just want it to create 4 new variables called stuff1, stuff2, stuff3, stuff4 with the corresponding assignments.  I realise that there are more elegant functions but this is just a model of a bigger situation.
>
> Thanks
>
> Jim
>
>
> ===============================
> Dr. Jim Maas
> University of East Anglia
>
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-help@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.
>

-- 
Ivan CALANDRA
PhD Student
University of Hamburg
Biozentrum Grindel und Zoologisches Museum
Abt. Säugetiere
Martin-Luther-King-Platz 3
D-20146 Hamburg, GERMANY
+49(0)40 42838 6231
ivan.calandra@uni-hamburg.de

**********
http://www.for771.uni-bonn.de
http://webapp5.rrz.uni-hamburg.de/mammals/eng/mitarbeiter.php


	[[alternative HTML version deleted]]

