Just read some introductory R tutorial...

> x = list ()
> x $ name1 = 1
> x $ name2 = 'a'
> x
$name1
[1] 1

$name2
[1] "a"
> name <- "name1"
> x[name]
$name1
[1] 1
> x[[name]]
[1] 1

> name <- "name2"
> x[name]
$name2
[1] "a"
> x[[name]]
[1] "a"


Bye,
Scionforbai

______________________________________________
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
and provide commented, minimal, self-contained, reproducible code.

Reply via email to