[R] looping variable names

Petr PIKAL petr.pikal at precheza.cz
Thu Feb 3 10:44:14 CET 2011


Hi

r-help-bounces at r-project.org napsal dne 03.02.2011 00:56:40:

> 
> Thanks for the reply!
> 
> This sounds great. Is there a nice way to store these 100 variable names 
in
> a list without typing them all out?

Why? When you need your 42nd variable from a list lll you can just use

lll[42]

and if you want each variable to have completely different name like

foo, asdsdf, jgjgjgjg, ble, bla

or other you need to do it manually. Or maybe use sample(letters, 6) to 
get random 6 letters names.

Regards
Petr




> -- 
> View this message in context: 
http://r.789695.n4.nabble.com/looping-variable-
> names-tp3255711p3256356.html
> Sent from the R help mailing list archive at Nabble.com.
> 
> ______________________________________________
> R-help at 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.



More information about the R-help mailing list