RosettaCodeData/Task/Associative-array-Iteration/R/associative-array-iteration-2.r

6 lines
137 B
R
Raw Permalink Normal View History

2013-04-10 14:58:50 -07:00
> index <- "1"
> env[[index]] <- "rainfed hay"
> for (name in ls(env)) {
+ cat(sprintf('index=%s, value=%s\n', name, env[[name]]))
+ }