On Tue, 19 Oct 2004, Kristin Kay Nicodemus wrote:

> Hi all,
>
> Hope someone can help me.  I start out with a matrix called haplo with 
> 600 rows and two columns.  To start with, the elements of the matrix are 
> character strings of 20 numbers.  I then want to create separate 
> objects, called ha1-ha600, that are the concatenated 20 + 20 numbers, as 
> numeric.  I am having no trouble doing anything except getting the index 
> i to paste to the object ha(i) in some fashion.  When I do 
> substring(haplo[(i)...) it works fine, but I can't seem to create 
> objects that are ha1 or ha2 etc., containing the 40 number row I just 
> created in the loop.  I've tried paste but I can't seem to get it to do 
> the right thing.


If you really want to create 600 objects, then you want
   assign(paste("ha",i,sep=""), ha)
and to retrieve them
   get(paste("ha",i,sep=""))

Often it is better to keep things like this in a list.

 	-thomas

______________________________________________
R-help@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

	[[alternative HTML version deleted]]


