automatic generation of variable names

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

automatic generation of variable names

Benjamin Otto-3
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

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: automatic generation of variable names

Uwe Ligges
Benjamin Otto wrote:

> Hi,
>
> is there some way to generate a varaible name automatically?


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

Uwe Ligges




> 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
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: automatic generation of variable names

Duncan Murdoch
On 2/23/2006 5:32 AM, Uwe Ligges wrote:
> Benjamin Otto wrote:
>
>> Hi,
>>
>> is there some way to generate a varaible name automatically?
>
>
> See the R FAQs: "How can I turn a string into a variable?"

Especially the last bit of advice there, which suggests using a list
instead.

Duncan Murdoch

>
> Uwe Ligges
>
>
>
>
>> 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
>>
>> ______________________________________________
>> [hidden email] mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: automatic generation of variable names

Benjamin Otto-3
Thanks for the quick help!

regards,
Benjamin

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html