Skip to content
Back to formatted view

Raw Message

Message-ID: <41AA0938.5010905@statistik.uni-dortmund.de>
Date: 2004-11-28T17:22:00Z
From: Uwe Ligges
Subject: creating a sequence of object names
In-Reply-To: <20041128170651.71853.qmail@web26309.mail.ukl.yahoo.com>

John wrote:

> Hello R-users,
> 
> I wanted to generate objects named 'my.ftn1',
> 'my.ftn2', ... , 'my.ftn10', and tried the following
> code without success. How can I do this?
> 
> 
>>for ( i in 1:10 ) {
> 
> + sub(" ", "", paste("my.ftn", i)) <- NULL
> + }
> Error: Target of assignment expands to non-language
> object
> 
> 
> Many thanks.
> 
> John
> 
> ______________________________________________
> 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


Please do as suggested above, read the posting guide!
It suggests to read the FAQs. FAQ 7.21 is what you are looking for: "How 
can I turn a string into a variable?".

Uwe Ligges