To iterate over a list by key, value pair, do this:
for (name in names(myList)) { print(name)<br /> print(myList[[name]])<br /> }
Note the double [[]] so you get just the value, not the pair.
To iterate over a list by key, value pair, do this:
for (name in names(myList)) { print(name)<br /> print(myList[[name]])<br /> }
Note the double [[]] so you get just the value, not the pair.
Thanks for that snippet!
I was able to write a script that allows me to list the levels associated with each of the named variables.
Ian
Very helpful. Better than the usual “LOOPS ARE EVIL!!111111″ instructions. Thanks!