Skip to content

automatic generation of variable names

4 messages · Benjamin Otto, Uwe Ligges, Duncan Murdoch

#
Hi,

is there some way to generate a varaible name automatically?

What I would like to do is:

Instead
-------

table1 <- orderbysomecolumn
table2 <- orderbysomecolumn
table3 <- orderbysomecolumn
...

automate
--------
for (i in 1:numoftables) {
   table%someconcatenation%i <- orderbysomecolumn
}

regards,
Benjamin
#
Benjamin Otto wrote:

            
See the R FAQs: "How can I turn a string into a variable?"

Uwe Ligges
#
On 2/23/2006 5:32 AM, Uwe Ligges wrote:
Especially the last bit of advice there, which suggests using a list 
instead.

Duncan Murdoch