Re: [Rd] list comprehension to create an arbitrary-sized list with arbitrary names/values

2010-10-13 Thread Erik Iverson
This question probably belongs on R-help instead of R-devel. What works best for you will depend on how big 'mylist' is. An article discussing some possibilities can be found at: http://opendatagroup.com/2009/07/26/hash-package-for-r/ Hope this helps, --Erik Steve Kim wrote: In python, one ca

Re: [Rd] list comprehension to create an arbitrary-sized list with arbitrary names/values

2010-10-13 Thread Olaf Mersmann
Hi, On 13.10.2010, at 21:26, Steve Kim wrote: > mydict = dict([(keyfun(x), valfun(x)) for x in mylist]) > > to create a dictionary with whatever keys and values we want from an > input list of arbitrary size. In R, I want to similarly create a list > with names/values that are generated by some k

[Rd] list comprehension to create an arbitrary-sized list with arbitrary names/values

2010-10-13 Thread Steve Kim
In python, one can do this mydict = dict([(keyfun(x), valfun(x)) for x in mylist]) to create a dictionary with whatever keys and values we want from an input list of arbitrary size. In R, I want to similarly create a list with names/values that are generated by some keyfun and valfun (assuming th